How to unselect all rows in a gridview - asp.net?

how to deselect all rows in a gridview - asp.net?

if I select one row in the GridView and do any update, how do I deselect this row?

thanks

+4
source share
2 answers

It looks like you can set SelectedIndex to -1 .

 gridView1.SelectedIndex = -1; 

Note. This must be done after each data binding to the GridView.

+11
source

As SvDevMan81 noted, you should set the GridView's SelectedIndex property to -1.

Similarly, if you have an editable grid and want to return the grid to read-only mode, you can set the GridView's EditIndex to -1. A.

0
source

Source: https://habr.com/ru/post/1335161/


All Articles