读书人

Gridview怎么给CommandField列增加Foo

发布时间: 2012-04-11 17:42:33 作者: rapoo

Gridview如何给CommandField列增加Footer
如题 增加的footer仍然是个按钮,用来添加时候确认用

[解决办法]
protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.Footer)
{
Button x = new Button();
x.OnClientClick = "return confirm('ok')";
x.Text = "确认删除";
e.Row.Cells[0].Controls.Add(x);
}
}

读书人网 >asp.net

热点推荐