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...
Selecting mutiple rows,cells or columns of a datagridview
Collapse
X
-
SelectionChange d is fired whenever the selection is changed at all. So, what you can do, is add an event handler for SelectionChange d. In this handler, check to see how many rows that are selected:Originally posted by ravitunkhi..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...
Code:if(dataGridView1.SelectedRows.Count > 1) { //code for multiple selected cells } else { //code for 1 or 0 selected cells }
Comment