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.
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.