<分区>
如何在gridview中动态添加页脚行。带有文本框..请给出任何想法...
<分区>
如何在gridview中动态添加页脚行。带有文本框..请给出任何想法...
最佳答案
由于在 GridView IMO 中只能有一个页脚行,因此最好通过将 GridView 的 ShowFooter
属性设置为 true
来添加页脚行。设定
FooterStyle
属性在这里很有用。
当来到编程部分时,
protected void MyGridView_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.Footer)
{
TextBox txt = new TextBox();
// set properties of text box
e.Row.Cells[0].Controls.Add(txt);
}
}
试试这个并发表评论。
编辑:这会很有帮助 http://www.asp.net/data-access/tutorials/displaying-summary-information-in-the-gridview-s-footer-cs
关于c# - 如何在 gridview 中动态添加页脚行。带文本框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3131448/