开发者

how to UnSelect all rows in GridView - asp.net?

开发者 https://www.devze.com 2023-02-03 22:11 出处:网络
how to UnSelect all rows in GridView - asp.net ? if i select 开发者_Go百科one row in GridView and make any refresh, how to unselect this row ?

how to UnSelect all rows in GridView - asp.net ?

if i select 开发者_Go百科one row in GridView and make any refresh, how to unselect this row ?

thanks


Looks like you can set the SelectedIndex to -1.

gridView1.SelectedIndex = -1;

Note: You will need to do this after each databind of new data to the GridView.


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

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

0

精彩评论

暂无评论...
验证码 换一张
取 消