protected void Grid_CustomCallback(object sender, ASPxGridViewCustomCallbackEventArgs e) { ASPxGridView parentGrid = sender as ASPxGridView; parentGrid.UpdateEdit(); parentGrid.DataBind(); if (String.IsNullOrEmpty(e.Parameters)) { return; } string[] paramArray = e.Parameters.Split(','); for (int i = 0; i < paramArray.Length; i++) { if (String.IsNullOrWhiteSpace(paramArray[i])) { continue; } ASPxGridView child = parentGrid.FindDetailRowTemplateControl(Convert.ToInt32(paramArray[i]), "grid2") as ASPxGridView; if (child != null) { child.UpdateEdit(); child.DataBind(); } } }
protected void grdData_HtmlRowCreated(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e) { if (e.RowType == DevExpress.Web.ASPxGridView.GridViewRowType.Detail) { ASPxGridView grdData = sender as ASPxGridView; ASPxGridView grv_hanghoa = grdData.FindDetailRowTemplateControl(e.VisibleIndex, "grv_hanghoa") as ASPxGridView; grv_hanghoa.DataSource = new[] { new{ productid = "SP0001", productname = "Hàng hóa 1", unit = "Hộp", number = "1.000", numberinventory = "200", returnNumber = "200", priceunit = "100.000", total = "100.000.000", lotid = "SL0001", duedate = "20/10/2015", reason = "Hỏng", note = "" }, new{ productid = "SP0002", productname = "Hàng hóa 2", unit = "Hộp", number = "1.000", numberinventory = "300", returnNumber = "200", priceunit = "100.000", total = "100.000.000", lotid = "SL0001", duedate = "20/10/2015", reason = "Hết hạn sử dụng", note = "" }, new{ productid = "SP0003", productname = "Hàng hóa 3", unit = "Hộp", number = "1.000", numberinventory = "300", returnNumber = "200", priceunit = "100.000", total = "100.000.000", lotid = "SL0001", duedate = "20/10/2015", reason = "Hết nhu cầu", note = "" }, new{ productid = "SP0004", productname = "Hàng hóa 4", unit = "Hộp", number = "1.000", numberinventory = "300", returnNumber = "200", priceunit = "100.000", total = "100.000.000", lotid = "SL0001", duedate = "20/10/2015", reason = "Hết nhu cầu", note = "" }, new{ productid = "SP0005", productname = "Hàng hóa 1", unit = "Hộp", number = "1.000", numberinventory = "250", returnNumber = "200", priceunit = "100.000", total = "100.000.000", lotid = "SL0001", duedate = "20/10/2015", reason = "Hỏng", note = "" }, new{ productid = "SP0006", productname = "Hàng hóa 2", unit = "Hộp", number = "1.000", numberinventory = "200", returnNumber = "200", priceunit = "100.000", total = "100.000.000", lotid = "SL0001", duedate = "20/10/2015", reason = "Hết hạn sử dụng", note = "" }, new{ productid = "SP0007", productname = "Hàng hóa 3", unit = "Hộp", number = "1.000", numberinventory = "200", returnNumber = "200", priceunit = "100.000", total = "100.000.000", lotid = "SL0001", duedate = "20/10/2015", reason = "Hết nhu cầu", note = "" }, new{ productid = "SP0008", productname = "Hàng hóa 4", unit = "Hộp", number = "1.000", numberinventory = "200", returnNumber = "200", priceunit = "100.000", total = "100.000.000", lotid = "SL0001", duedate = "20/10/2015", reason = "Hết nhu cầu", note = "" }, new{ productid = "SP0009", productname = "Hàng hóa 1", unit = "Hộp", number = "1.000", numberinventory = "200", returnNumber = "200", priceunit = "100.000", total = "100.000.000", lotid = "SL0001", duedate = "20/10/2015", reason = "Hỏng", note = "" }, new{ productid = "SP00010", productname = "Hàng hóa 2", unit = "Hộp", number = "1.000", numberinventory = "200", returnNumber = "200", priceunit = "100.000", total = "100.000.000", lotid = "SL0001", duedate = "20/10/2015", reason = "Hết hạn sử dụng", note = "" }, new{ productid = "SP00011", productname = "Hàng hóa 3", unit = "Hộp", number = "1.000", numberinventory = "200", returnNumber = "200", priceunit = "100.000", total = "100.000.000", lotid = "SL0001", duedate = "20/10/2015", reason = "Hết nhu cầu", note = "" }, new{ productid = "SP00012", productname = "Hàng hóa 4", unit = "Hộp", number = "1.000", numberinventory = "200", returnNumber = "200", priceunit = "100.000", total = "100.000.000", lotid = "SL0001", duedate = "20/10/2015", reason = "Hết nhu cầu", note = "" }, }; grv_hanghoa.DataBind(); } }
protected void grd_pricepolicy_HtmlRowCreated(object sender, ASPxGridViewTableRowEventArgs e) { if (e.RowType == GridViewRowType.Detail) { ASPxGridView mastergrv = sender as ASPxGridView; ASPxGridView detailgrv = mastergrv.FindDetailRowTemplateControl(e.VisibleIndex, "grv_referencePrice") as ASPxGridView; detailgrv.DataSource = grv_referencePriceSource; detailgrv.DataBind(); } }
protected void grv_SelectPaymentPlan_OnHtmlRowCreated(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e) { if (e.RowType == DevExpress.Web.ASPxGridView.GridViewRowType.Detail) { ASPxGridView grid = sender as ASPxGridView; ASPxGridView subgrid = grid.FindDetailRowTemplateControl(e.VisibleIndex, "grv_PaymentProcess") as ASPxGridView; subgrid.DataSource = grv_PaymentProcessSource; subgrid.DataBind(); } }
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(); } }
protected void grid_dmorder_HtmlRowCreated(object sender, ASPxGridViewTableRowEventArgs e) { if (e.RowType == GridViewRowType.Detail) { ASPxGridView master = sender as ASPxGridView; ASPxGridView grd_selectproduct = master.FindDetailRowTemplateControl(e.VisibleIndex, "grd_selectproduct") as ASPxGridView; grd_selectproduct.HtmlRowPrepared += new ASPxGridViewTableRowEventHandler(grd_addproduct_HtmlDataCellPrepared); grd_selectproduct.DataSource = new[] { new{ stt = 1, productid = "SP00001", productname = "Hàng hóa 1", unit = "Hộp", number = 500, priceunit = "5.000", total = "2.500.000", lotid = "SL0001", duedate = "01/07/2015", note = "Hàng mới" }, new{ stt = 2, productid = "SP00002", productname = "Hàng hóa 2", unit = "Hộp", number = 50, priceunit = "5.000", total = "2.500.000", lotid = "SL0002", duedate = "01/08/2014", note = "Note" }, new{ stt = 3, productid = "SP00003", productname = "Hàng hóa 3", unit = "Thùng", number = 70, priceunit = "5.000", total = "2.500.000", lotid = "SL0002", duedate = "01/09/2016", note = "Ví dụ" } }; grd_selectproduct.DataBind(); } }
protected void grid_HtmlRowCreated(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e) { if (e.RowType == GridViewRowType.Detail) { ASPxGridView gridView = (ASPxGridView)sender; ASPxPageControl pc = (ASPxPageControl)gridView.FindDetailRowTemplateControl(e.VisibleIndex, "ASPxPageControl1"); ASPxGridView detailGridView = (ASPxGridView)pc.TabPages[0].FindControl("g_relatedProducts"); detailGridView.ClientInstanceName = "detailGridView" + e.VisibleIndex.ToString(); Button button = (Button)pc.TabPages[0].FindControl("Button1"); button.OnClientClick = "return OnButtonClick(" + e.VisibleIndex.ToString() + ")"; object selectC = Session[detailGridView.GetMasterRowKeyValue().ToString()]; if (selectC != null) { HtmlInputText editor = (HtmlInputText)pc.TabPages[0].FindControl("SearchString"); string selectCommand = selectC.ToString(); int indexStart = selectCommand.IndexOf("%"); int indexFinish = selectCommand.IndexOf("%", indexStart + 1); editor.Value = selectCommand.ToString().Substring(indexStart + 1, indexFinish - indexStart - 1); } } }
protected void gridview_applykm_HtmlRowCreated(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e) { if (e.RowType == DevExpress.Web.ASPxGridView.GridViewRowType.Detail) { ASPxGridView mastergrid = sender as ASPxGridView; ASPxPageControl tabs = mastergrid.FindDetailRowTemplateControl(e.VisibleIndex, "tab_stepkhuyenmai") as ASPxPageControl; /* Setting for tab 1 */ ASPxNavBar navbar_info = tabs.TabPages[0].FindControl("navbar_info") as ASPxNavBar; ASPxFormLayout form_infoquyenloi = navbar_info.Groups[1].FindControl("form_infoquyenloi") as ASPxFormLayout; ASPxGridView gridview_hanghoatang = form_infoquyenloi.FindControl("gridview_hanghoatang") as ASPxGridView; gridview_hanghoatang.DataSource = new[] { new{ sequenceno = "01", productid = "SP00001", productname = "Hàng hóa 1", productunitid = "Hộp", lotid = "L00001", condition_buy = "5", condition_give = "1" }, new{ sequenceno = "02", productid = "SP00002", productname = "Hàng hóa 2", productunitid = "Hộp", lotid = "L00002", condition_buy = "10", condition_give = "1" }, new{ sequenceno = "03", productid = "SP00003", productname = "Hàng hóa 3", productunitid = "Thùng", lotid = "L00003", condition_buy = "100", condition_give = "1" }, }; gridview_hanghoatang.DataBind(); gridview_hanghoatang.Visible = true; ASPxLabel lbl_title_khuyenmai2 = form_infoquyenloi.FindControl("lbl_title_khuyenmai2") as ASPxLabel; lbl_title_khuyenmai2.Visible = true; ASPxGridView gridview_hanghoabonus = form_infoquyenloi.FindControl("gridview_hanghoabonus") as ASPxGridView; gridview_hanghoabonus.DataSource = new[] { new { TenQuaTang = "Phiếu Giảm Giá", GiaTri = "15.000", SoLuong = "2", ThanhTien = "30.000", MoTa = "NAAN Solution" }, new { TenQuaTang = "Gấu Bông", GiaTri = "15.000", SoLuong = "3", ThanhTien = "45.000", MoTa = "NAAN Solution" }, }; gridview_hanghoabonus.DataBind(); gridview_hanghoabonus.Visible = false; ASPxLabel lbl_title_khuyenmai3 = form_infoquyenloi.FindControl("lbl_title_khuyenmai3") as ASPxLabel; ASPxRoundPanel round_chietkhau = form_infoquyenloi.FindControl("round_chietkhau") as ASPxRoundPanel; round_chietkhau.Visible = false; lbl_title_khuyenmai3.Visible = false; /* Setting for tab 2 */ ASPxNavBar navbar_nextinfo = tabs.TabPages[1].FindControl("navi_nextinfo") as ASPxNavBar; form_infoquyenloi = navbar_nextinfo.Groups[1].FindControl("form_infoquyenloi") as ASPxFormLayout; gridview_hanghoatang = form_infoquyenloi.FindControl("gridview_hanghoatang") as ASPxGridView; gridview_hanghoatang.DataSource = new[] { new{ sequenceno = "01", productid = "SP00001", productname = "Hàng hóa 1", productunitid = "Hộp", lotid = "L00001", condition_buy = "5", condition_give = "1" }, new{ sequenceno = "02", productid = "SP00002", productname = "Hàng hóa 2", productunitid = "Hộp", lotid = "L00002", condition_buy = "10", condition_give = "1" }, new{ sequenceno = "03", productid = "SP00003", productname = "Hàng hóa 3", productunitid = "Thùng", lotid = "L00003", condition_buy = "100", condition_give = "1" }, }; gridview_hanghoatang.DataBind(); gridview_hanghoatang.Visible = false; lbl_title_khuyenmai2 = form_infoquyenloi.FindControl("lbl_title_khuyenmai2") as ASPxLabel; lbl_title_khuyenmai2.Visible = false; gridview_hanghoabonus = form_infoquyenloi.FindControl("gridview_hanghoabonus") as ASPxGridView; gridview_hanghoabonus.DataSource = new[] { new { TenQuaTang = "Phiếu Giảm Giá", GiaTri = "15.000", SoLuong = "2", ThanhTien = "30.000", MoTa = "NAAN Solution" }, new { TenQuaTang = "Gấu Bông", GiaTri = "15.000", SoLuong = "3", ThanhTien = "45.000", MoTa = "NAAN Solution" }, }; gridview_hanghoabonus.DataBind(); gridview_hanghoabonus.Visible = true; round_chietkhau = form_infoquyenloi.FindControl("round_chietkhau") as ASPxRoundPanel; round_chietkhau.Visible = true; } }