I am trying to understand some kind of behavior in an application that I support. Excerpt:
foreach (DataGridViewRow pGridRow in grdEmail.Rows)
{
pGridRow.Cells[0].Value = chkSelectAll.Checked;
pCount = pGridRow.Index + 1;
}
Typically, you try to select all rows in a grid (check the box) when you click the Select All check box.
When a grid has several rows (a hundred or so), it works beautifully. However, when I have about 5,000 lines in it, this thing scans. The command pGridRow.Cells[0].Value = chkSelectAll.Checkedtakes a second or so (in time, placing Console.prints above and below it).
Any idea would be appreciated in resolving this issue.
source
share