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?
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/>