Hello,
I have a grid where I set the column width in the InitializeLayout event. When I first bind a DataSet to the DataSource property the columns display with the correct width. However, if I rebind the DataSet the columns becomes smalle. Any subsequent bindings does not change the column width. Any explanations?
What exactly do you mean by "rebind the DataSet". It sounds to me like whatever youare doing it causing the data source to send a Reset notification to the grid, which means the grid has to throw away all existing columns and rows and re-load everything from scratch.
By rebind the dataset I mean:
myGrid.DataSource = null;
myGrid.DataSource = myDataSet;
I think I know what is causing the problem. When a grid has 2 bands (or more) the column width seems to be the combined width of the columns that are stacked on top of each other within the bands. The visual width of the column is different from the Width property of the column object. Any ideas why this is? Is it a bug?