|
-
September 28th, 2011, 10:26 PM
#1
FillWeight values cannot exceed 65535.
I have a datagrid which contains 750 columns. When I try to assign it to datasource, I get the following error
An unhandled exception of type 'System.InvalidOperationException' occurred in System.Windows.Forms.dll
Additional information: Sum of the columns' FillWeight values cannot exceed 65535.
My code is as follows
Public TaView As DataView
Dim table As DataTable = New DataTable
for i = 0 to 750
table.Columns.Add(i.ToString())
Next
frmDatagrid.TaView = New DataView(table)
frmDatagrid.dataView.DataSource = frmDatagrid.TaView 'The crash happens here
I think I need to SetWeight to 1 for all columns. But how can it be done before assigning to datasource.
-
September 29th, 2011, 10:52 AM
#2
Re: FillWeight values cannot exceed 65535.
Here's a good link giving somewhat of a solution:
http://social.msdn.microsoft.com/for...-54509fdf3c4f/
"You'll need to set AutoGenerateColumns to false and manually add the columns"
Looks like grid views (and DGV) were not designed for a large collection of columns.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|