how count number of selected rows in datagridview?
let's highlighted 5 rows, how can show in message box?
please i'm using winforms in c#!
you need set yourgridview.multiselect=true
; multiselect when multiselect property set true, multiple elements (cells, rows, or columns) can selected in datagridview control. select multiple elements, user can hold down ctrl key while clicking elements select. consecutive elements can selected clicking first element select , then, while holding down shift key, clicking last element select.
then can use selectrows.count property selectedrows
messagebox.show(yourdatagridview.selectedrows.count.tostring());
Comments
Post a Comment