Hi,
I'm developing a VSPackage (extension for Visual Studio 2010), and I have a tool window that is hosting a DataGridView control.
I have a very large data-set (e.g. 2D array of size 16384 x 16384) that I wish to display on the grid, and I update the data in the view via VirtualMode.
I want to add index to the row header cells and column header cells, so I tried the following:
- Auto resize via grid methods
grid.AutoResizeRowHeadersWidth(DataGridViewRowHeadersWidthSizeMode.AutoSizeToDisplayedHeaders);
2. Iterating through each row & updating:
foreach(DataGridViewRow row in grid.Rows){ row.HeaderCell.Value=(row.Index+1).ToString();}
3. Subscribing to RowsAdded/OnPaint and updating the value there.
But, all these methods were SUPER SLOW!
They significantly degraded the rendering of the DGV (takes like ~ 5 seconds or more to render the view after each of these methods, or even worse).
What would you suggest to do instead?
Thanks,
Ofir