在GridView1_RowDeleting中能调用按钮事件吗?
相关推荐
GridView行中按钮的使用
在web项目的过程中,特别是开发ASP.NET应用程序,经常会用到数据显示空间GridView控件,然后需要每行的结尾放置一个button或linkbutton来对当前行进行操作。如下图,添加一个删除按钮,当点击按钮时删除所在行的记录。
ASP.NET GridView做增删改查操作
ASP.NET GridView做增删改查操作
[GridView控件]事件详解.doc
[GridView控件]事件详解.doc
GridView事件大全
//RowCommand事件需要添加CommandArgument protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e) { LinkButton totop; LinkButton tobottom; if (e.Row.RowType == DataControlRowType.DataRow) { totop = (LinkButton)e.Row.FindControl("totop"); tobottom = (LinkButton)e.Row.FindControl("tobottom"); if (totop != null) { if (totop.CommandName == "topstep") totop.CommandArgument = e.Row.RowIndex.ToString(); if (tobottom.CommandName == "bottomstep") tobottom.CommandArgument = e.Row.RowIndex.ToString(); } } } }
动态添加,删除 gridview 行
可以手动添加行,删除新增行点击保存批量保存数据


