Beispiel #1
0
 protected void ASPxGridView3_DetailRowExpandedChanged(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewDetailRowEventArgs e)
 {
     if (e.Expanded.ToString().Equals("True"))
     {
         ASPxGridView gr   = sender as ASPxGridView;
         ASPxGridView grdt = gr.FindDetailRowTemplateControl(e.VisibleIndex, "ASPxGridView2") as ASPxGridView;
         grdt.DataSource = new[] { new{ ID = "NL001", Tp = "Nguyên liệu A", bg = "10", dg = "Bao gồm 10 nguyên liệu A" },
                                   new{ ID = "NL002", Tp = "Sản phẩm dở dang A", bg = "2", dg = "Bao gồm 2 sản phẩm dở dang A" },
                                   new{ ID = "NL002", Tp = "Sản phẩm dở dang B", bg = "3", dg = "Bao gồm 3 sản phẩm dở dang B" } };
         grdt.KeyFieldName = "ID";
         grdt.DataBind();
     }
 }
Beispiel #2
0
        protected void gvJurnal_DetailRowExpandedChanged(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewDetailRowEventArgs e)
        {
            if (e.Expanded && e.VisibleIndex >= 0 && e.VisibleIndex < gvJurnal.VisibleRowCount)
            {
                var noBukti = gvJurnal.GetRowValues(e.VisibleIndex, "NoBukti").ToString();

                var detailData = jurnalBll.GetDetailByNoBukti(noBukti);

                var gvDetail = (ASPxGridView)gvJurnal.FindDetailRowTemplateControl(e.VisibleIndex, "gvDetail");
                if (gvDetail != null)
                {
                    gvDetail.DataSource = detailData;
                    gvDetail.DataBind();
                }
            }
        }