Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm Controls / January 2007

Tip: Looking for answers? Try searching our database.

Sum of the columns' FillWeight values cannot exceed 65535.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
hometoast - 30 Jan 2007 20:19 GMT
This is really a two part question.

I love the DataGridView for small amounts of data.  I have some tables
I'd like to load but they have many, many columns (900-1000) for some
workloads.

Running this code:
---------
Public Class Form1
  Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
     Dim dt As DateTime = Now
     For intX As Integer = 1 To 1000
        Debug.WriteLine(Now.Subtract(dt).TotalSeconds)
        Me.DataGridView1.Columns.Add(intX.ToString, intX.ToString)
     Next
  End Sub
End Class
--------

I get the exception from the subject at (you, guessed it) 656
columns.  I could create the column and then set its weight to 1 and
then add it and that would solve the total weight problem.  But the
bigger issue is that it takes 20-30 seconds to even get to that point.

What can I change to keep this (IMO) super simple snippet of code from
eating up so much time?
Tim Van Wassenhove - 30 Jan 2007 22:46 GMT
hometoast schreef:
> This is really a two part question.
>
[quoted text clipped - 20 lines]
> then add it and that would solve the total weight problem.  But the
> bigger issue is that it takes 20-30 seconds to even get to that point.

You may want to have a look at:
http://www.timvw.be/adding-datagridviewcolumns-lots-of-them/

Especially setting the ColumnHeadersHeightSize and RowHeadersHeightSize
properties to DisableResizing resulted in a drastic improvement for me...

Signature

Tim Van Wassenhove <url:http://www.timvw.be/>

hometoast - 31 Jan 2007 12:47 GMT
That did it; thank you so much.  My colleague who wrote his own custom
grid control isn't too happy

On Jan 30, 5:46 pm, Tim Van Wassenhove <t...@users.sourceforge.net>
wrote:
> hometoast schreef:
>
[quoted text clipped - 30 lines]
> --
> Tim Van Wassenhove <url:http://www.timvw.be/>

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.