hi..i have a datagridview in my windows application using C#......i want to select mutiple cells(by pressing shift key) or select mutiple columns or multiple rows.....if this happens then i should disable a button control....plz tell me what event gets fired if a user selects multiple cells or columns or rows..so tht i can write code to disable a button....plz reply back soon...thks for any assistance...
SelectionChanged is fired whenever the selection is changed at all. So, what you can do, is add an event handler for
SelectionChanged. In this handler, check to see how many rows that are selected:
-
if(dataGridView1.SelectedRows.Count > 1)
-
{
-
//code for multiple selected cells
-
}
-
else
-
{
-
//code for 1 or 0 selected cells
-
}
-