Hello,
I have an application that is using the RadGridView.
The initialization of the Grid sets "AutoColumnSizeMode = GridViewAutoColumnSizeMode.Fill".
The very first time the grid is populated, formatted, and then BestFitColumns(BestFitColumnsMode.AllCells) is called, and everything looks good.
The issue arises after this "first" grid fill.
When we refresh the grid with a new databsource and reformat the grid, again the BetstFitColumns(BestFitColumnsMode.AllCells) is called.
Process is as follows:
grid.DataSource = null;
grid.ResetDataBinding();
...
...
grid.DataSource = newDataSource;
FormatGrid();
BestFitColumns(BestFitColumnsMode.AllCells);
We are using a data-source which initially includes a lot of columns, but upon 'formatting' the grid we are also limiting the visible columns by hiding them all, then showing the select few that we need.
The attachment shows what the result is after the first grid fill... looks awful.
To further my confusion, I have added a checkbox turn on / off BestFit (BestFitColumns(BestFitColumnsMode.AllCells / None), and after 3-4 times of hitting this, it looks good again. Refresh datasources again and everything is back to messed up.
How in the world do i get this to be consistent the first time and every time after that??
I hope I have explained the issue with enough detail. Let me know if you have question.