Reputation: 383
Hello i basically added datagridviews dynamically to my windows form application, and added cellClick event handlers dynamically by looping through all the datagridview control, however my event doesnt fire consistently, like when i click really fast it wont clear the selection sometimes. here is my code
void DGV_CellClick(Object sender, EventArgs e)
{
DataGridView dgv = (DataGridView)sender;
dgv.ClearSelection();
}
foreach(KeyValuePair<int,datagridview>entry in DGVCollection)
{
datagridview dgv = entry.value;
dgv.CellClick+= DGV_CellClick;
}
Upvotes: 0
Views: 84