如何在行模板上设置多行的网格视图

时间:2013-11-25 13:10:21

标签: c# asp.net

我的一个项目我需要像下面这样设计gridView:

如何在asp.net Web应用程序中创建任何建议。

先谢谢 EN

1 个答案:

答案 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/