UP~! 这个是本人的界面,根据选中的行来进行删除GridView中的行这个是本人的代码,删除代码这个是生成的错误信息.请问哪个高人能够指点指点.本人还是个在校学生要做个固定资产管理系统网站,希望好心人能够指导指导该学生!谢谢! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 恩是啊这个是什么事件..我在我的GridVeiw内没找到这个事件啊!有点奇怪. 建议把删除按钮对应的列在GridView中改成TemplateField.<asp:TemplateField ShowHeader="False"> <ItemTemplate> <asp:Button ID="ButtonDelete" runat="server" CausesValidation="False" CommandName="Delete" Text="删除"> </asp:Button> </ItemTemplate></asp:TemplateField> protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e){ if (e.Row.RowType == DataControlRowType.DataRow) { e.Row.Attributes["onmouseover"] = "currentcolor=this.style.backgroundColor; this.style.backgroundColor='#C9D9FB'"; e.Row.Attributes["onmouseout"] = "this.style.backgroundColor=currentcolor;"; Button btn = (Button)e.Row.FindControl("ButtonDelete"); DataRowView drv = (DataRowView)e.Row.DataItem; btn.OnClientClick = "return confirm('你确实要删除[" + drv["WarehouseName"].ToString() + "]吗?');"; }} 不可能,你是用VS2005吗?如果是的话,你先选中GridView,然后在属性中的雷电状项中可以选择RowDeleting事件。 定义GridView RowDeleting事件就行了。 这段简单的代码为什么不行? 走过路过帮我看看, 谢谢! 无法打开 ArrayList的一个问题,帮忙看看?? 小弟我刚接触MYSQL,现来问个简单的问题 求助!用Gridview进行存储过程分页的问题, repeater分页删除数据再次绑定的问题 求助:关于一个WEB网站方面的问题请教(模仿阿里巴巴网站里的效果 急啊,在线等,关MAIL的问题。 一个正则表达式的匹配问题 菜鸟提问 如何多个人分地区协作开发? ASP.NET
这个是什么事件..我在我的GridVeiw内没找到这个事件啊!
有点奇怪.
<asp:TemplateField ShowHeader="False">
<ItemTemplate>
<asp:Button ID="ButtonDelete" runat="server" CausesValidation="False"
CommandName="Delete" Text="删除">
</asp:Button>
</ItemTemplate>
</asp:TemplateField> protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes["onmouseover"] = "currentcolor=this.style.backgroundColor; this.style.backgroundColor='#C9D9FB'";
e.Row.Attributes["onmouseout"] = "this.style.backgroundColor=currentcolor;"; Button btn = (Button)e.Row.FindControl("ButtonDelete");
DataRowView drv = (DataRowView)e.Row.DataItem;
btn.OnClientClick = "return confirm('你确实要删除[" + drv["WarehouseName"].ToString() + "]吗?');";
}
}
不可能,你是用VS2005吗?如果是的话,你先选中GridView,然后在属性中的雷电状项中可以选择RowDeleting事件。