I am working on a WinForms Application, that have a DataGridView, this Control emulates a TreeView, so the RowCount changes drastically. I am having a performance issue when collapsing rows...
// dataGrid.VirtualMode = true;
// dataGrid.RowCount = 100.000;
dataGrid.RowCount = 2; // Is too Slow!
Since you using VirtualMode
, it is usually much faster to do like this:
dataGrid.Rows.Clear();
dataGrid.RowCount = 2;