Clearing a Formatted DataGridView
When I try to clear controls and DataviewGrid from a panel which has bound data, it takes several seconds to do it, when I have this line
GridHandle.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCellsIf Comment this line then it clears fast. If comment the above line then it clears faster.Any help would be appreciated.
Khalid Mirza
mirza@Stellex.com
Any changes done to the DataGridView's content -- removing rows for example causes the grid to recompute autosize mode. Depending upon the number of rows this can take more time. It is a good idea when you know that you are going to perform a large update and you are using an autosize mode, to set the AutoSizeColumnsMode to None, do the large update, then reset the AutoSizeColumnsMode back to AllCells.
Hope this helps,
-mark
DataGridView Program Manager
Microsoft
This post is provided "as-is"