我的一个项目我需要像下面这样设计gridView:
如何在asp.net Web应用程序中创建任何建议。
先谢谢 EN
答案 0 :(得分:1)
protected void Page_Load(object sender, EventArgs e) {
if (!IsPostBack)
{
DataSet ds = BOL.GetFilesFromCart();
GridView1.DataSource = ds;
GridView1.DataBind();
}
}
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
GridView gv = (GridView)e.Row.FindControl("GridView2");
DataSet ds1 = BOL.GetPrintSize();
ImageButton ib = (ImageButton)e.Row.FindControl("ImageButton1");
gv.DataSource = ds1;
gv.DataBind();
}
}
有关完整指南,请参阅:
http://www.c-sharpcorner.com/uploadfile/a577f3/gridview-nested-inside-another-gridview-in-Asp-Net/