且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何使用删除按钮删除gridview中的行

更新时间:2022-06-17 07:14:06

关注此



生成网格视图的rowdeleting事件

在此事件中查找要使用e.RowIndex删除的行的行ID。

现在你有了你需要的行的id使用查询应用Remove方法。

然后make savechanges

然后再次将数据源绑定到网格。



谢谢,

Mukesh
Follow this

generate rowdeleting event of grid view
inside this event find row id of row which you want to delete using e.RowIndex.
now you have id of the row you just need to apply Remove method using query.
then make savechanges
then again bind your datasource to the grid.

thanks,
Mukesh