上面的问题解决了,请回答下面这个问题吧:如何为DATAGRID里面的删除按钮加一段程序使他能够弹出确认的对话框,谢谢!给点代码例子
解决方案 »
- 从网页中提取html存入txt文件后,如何得到指定标签的属性值?
- c# hook ws2_32.dll 问题
- [请教] C#控件导出问题~~~~
- C#的电子邮件程序,单步调试能通过但是整体运行的时候有问题,请高手指点,谢谢
- 关于asp.net日历控件
- 如何用代码实现将一个RSA密钥放入Windows系统的密钥容器中?
- GridView模板列的按钮的事件
- 图像处理高手请进-高分求带羽化功能的图像拷贝
- 如何获得已经打开的excel文件的文件路径,文件名
- 操作时间太长的问题,求助!
- 关于定义:System.Runtime.CompilerServices.CompilerGlobalScopeAttribute??
- 在WINFORM中如何改变datagrid的标头,和实现对DATAGRID中数据的编辑?
5.55 How can I put up a confirmation question when the user tries to delete a row in the datagrid by clicking on the row header and pressing the Delete key?
http://www.syncfusion.com/FAQ/WinForms/FAQ_c44c.asp#q889q
int ss = ( int ) r ;
if ( ss == 6 ) // 按动"确定"按钮
{ ........
}
((LinkButton)e.Item.FindControl("Delete")).Attributes["OnClick"]="javascript:return window.confirm('您确认要删除吗?');";
}在DataGrid的ItemCommand中处理删除事件.
<Columns>
<asp:EditCommandColumn ButtonType="PushButton" UpdateText="更新" CancelText="取消" EditText="编辑"></asp:EditCommandColumn>
<asp:ButtonColumn Text="删除" ButtonType="PushButton" CommandName="Delete"></asp:ButtonColumn>
</Columns>
</asp:datagrid>
<itemplate>
<asp:linkbutton id="delete" runat=server>删除</asp:linkbutton>
</itemlate>
</asp:templatecolumn>来实现在ItemCommand中你可以利用e.Item.ItemIndex判断在第几行,或利用绑定的CommandArgument来判断是哪个行。