protected override void Page_Init(object sender, EventArgs e) { base.Page_Init(sender, e); if (this.CurrentScope() == Scope.CustomerScope) { //start child grid initialization cffGGV_TransactionGridViewChild = new CffGenGridView(); cffGGV_TransactionGridViewChild.AllowSorting = true; cffGGV_TransactionGridViewChild.AutoGenerateColumns = false; cffGGV_TransactionGridViewChild.SetSortExpression = "Date"; cffGGV_TransactionGridViewChild.Width = Unit.Percentage(50); cffGGV_TransactionGridViewChild.EmptyDataRowStyle.CssClass = "dxgvEmptyDataRow td"; cffGGV_TransactionGridViewChild.ViewStateMode = System.Web.UI.ViewStateMode.Enabled; //cffGGV_TransactionGridViewChild.BorderColor = System.Drawing.Color.AliceBlue; //cffGGV_TransactionGridViewChild.RowStyleHighlightColour = System.Drawing.Color.Honeydew; //cffGGV_TransactionGridViewChild.AlternatingRowStyle.BackColor = System.Drawing.Color.AliceBlue; //note: for nested grid leave some space for maximize/minimize button cffGGV_TransactionGridViewChild.Columns.Clear(); cffGGV_TransactionGridViewChild.InsertDataColumn("Date", "Date", CffGridViewColumnType.Text, "5%", "cffGGV_leftAlignedCell", HorizontalAlign.Left, HorizontalAlign.Left, false); cffGGV_TransactionGridViewChild.InsertDataColumn("Processed", "Processed", CffGridViewColumnType.Text, "5%", "cffGGV_leftAlignedCell", HorizontalAlign.Left, HorizontalAlign.Left, false); cffGGV_TransactionGridViewChild.InsertDataColumn("Type", "Type", CffGridViewColumnType.Text, "5%", "cffGGV_leftAlignedCell", HorizontalAlign.Left, HorizontalAlign.Left, false); cffGGV_TransactionGridViewChild.InsertDataColumn("Number", "Number", CffGridViewColumnType.Text, "5%", "cffGGV_leftAlignedCell", HorizontalAlign.Left, HorizontalAlign.Left, false); cffGGV_TransactionGridViewChild.InsertDataColumn("Reference", "Reference", CffGridViewColumnType.Text, "5%", "cffGGV_leftAlignedCell", HorizontalAlign.Left, HorizontalAlign.Left, false); cffGGV_TransactionGridViewChild.InsertCurrencyColumn("Debit", "Amount", "6%", "cffGGV_currencyCell", true, HorizontalAlign.Right, HorizontalAlign.Right); cffGGV_TransactionGridViewChild.InsertCurrencyColumn("Credit", "Balance", "6%", "cffGGV_currencyCell", true, HorizontalAlign.Right, HorizontalAlign.Right); cffGGV_TransactionGridViewChild.InsertBoundHyperLinkColumn("Batch", "Batch", "Batch", "5%", "cffGGV_centerAlignedCell", HorizontalAlign.Center, HorizontalAlign.Center, "Type:Invoice:On:IsReversed"); cffGGV_TransactionGridViewChild.Columns[7].ItemStyle.HorizontalAlign = HorizontalAlign.Left; cffGGV_TransactionGridViewChild.EnableViewState = true; cffGGV_TransactionGridViewChild.NestedSettings.Enabled = false; cffGGV_TransactionGridViewChild.TotalsSummarySettings.TableClass = "dxgvFooter"; //dbb cffGGV_TransactionGridViewChild.TotalsSummarySettings.SetColumnTotals("Balance, Amount"); cffGGV_TransactionGridViewChild.TotalsSummarySettings.SetSummaryTotalColumnCssStyle("Balance", "cffGGV_currencyCell"); cffGGV_TransactionGridViewChild.TotalsSummarySettings.SetSummaryTotalColumnCssStyle("Amount", "cffGGV_currencyCell"); cffGGV_TransactionGridViewChild.CustomFooterSettings = CffCustomFooterMode.ShowTotals | CffCustomFooterMode.DefaultSettings; } //start parent grid initialization cffGGV_TransactionGridView = new CffGenGridView(); cffGGV_TransactionGridView.AllowSorting = true; cffGGV_TransactionGridView.AutoGenerateColumns = false; cffGGV_TransactionGridView.SetSortExpression = "YrMonth"; cffGGV_TransactionGridView.Width = Unit.Percentage(100); cffGGV_TransactionGridView.BorderColor = System.Drawing.Color.LightGray; cffGGV_TransactionGridView.PageSize = 250; cffGGV_TransactionGridView.EnableViewState = true; if (Request.Browser.Id.ToUpper().Contains("IE")) { cffGGV_TransactionGridView.BorderWidth = Unit.Pixel(1); } cffGGV_TransactionGridView.HeaderStyle.CssClass = "dxgvHeader td"; cffGGV_TransactionGridView.ViewStateMode = System.Web.UI.ViewStateMode.Enabled; cffGGV_TransactionGridView.AlternatingRowStyle.BackColor = System.Drawing.Color.Honeydew; //cffGGV_TransactionGridView.RowStyleHighlightColour = System.Drawing.Color.Honeydew; cffGGV_TransactionGridView.EmptyDataRowStyle.CssClass = "dxgvEmptyDataRow td"; if (this.CurrentScope() == Scope.CustomerScope) { cffGGV_TransactionGridView.NestedSettings.Enabled = true; cffGGV_TransactionGridView.NestedSettings.Expanded = false; cffGGV_TransactionGridView.NestedSettings.ExpandingButtonHeight = System.Web.UI.WebControls.Unit.Pixel(10); cffGGV_TransactionGridView.NestedSettings.ExpandingButtonWidth = System.Web.UI.WebControls.Unit.Pixel(10); cffGGV_TransactionGridView.NestedSettings.ExpandingColumnWidth = System.Web.UI.WebControls.Unit.Percentage(2); cffGGV_TransactionGridView.NestedSettings.childGrid = cffGGV_TransactionGridViewChild; } else { cffGGV_TransactionGridView.NestedSettings.Enabled = false; } cffGGV_TransactionGridView.InsertDataColumn("Month", "YrMonth", CffGridViewColumnType.Text, "5%", "cffGGV_leftAlignedCell", HorizontalAlign.Left, HorizontalAlign.Left, false); cffGGV_TransactionGridView.InsertCurrencyColumn("Funding", "Factored", "8%", "cffGGV_currencyCell", true, HorizontalAlign.Right, HorizontalAlign.Right); cffGGV_TransactionGridView.InsertCurrencyColumn("Non Funding", "NonFactored", "8%", "cffGGV_currencyCell", true, HorizontalAlign.Right, HorizontalAlign.Right); cffGGV_TransactionGridView.InsertCurrencyColumn("Credit", "Credit", "8%", "cffGGV_currencyCell", true, HorizontalAlign.Right, HorizontalAlign.Right); cffGGV_TransactionGridView.InsertCurrencyColumn("Receipt", "Receipt", "8%", "cffGGV_currencyCell", true, HorizontalAlign.Right, HorizontalAlign.Right); cffGGV_TransactionGridView.InsertCurrencyColumn("Journal", "Journal", "8%", "cffGGV_currencyCell", true, HorizontalAlign.Right, HorizontalAlign.Right); cffGGV_TransactionGridView.InsertCurrencyColumn("Discount", "Discount", "8%", "cffGGV_currencyCell", true, HorizontalAlign.Right, HorizontalAlign.Right); cffGGV_TransactionGridView.InsertCurrencyColumn("Prepayments", "Repurchase", "8%", "cffGGV_currencyCell", true, HorizontalAlign.Right, HorizontalAlign.Right); cffGGV_TransactionGridView.InsertCurrencyColumn("OverPayment", "OverPayment", "8%", "cffGGV_currencyCell", true, HorizontalAlign.Right, HorizontalAlign.Right); cffGGV_TransactionGridView.EnableViewState = true; cffGGV_TransactionGridView.CaptionHeaderSettings.BoldCaption = true; //set summary settings cffGGV_TransactionGridView.TotalsSummarySettings.SetColumnTotals("Factored, NonFactored, Credit, Receipt, Journal, Discount, Repurchase, OverPayment"); cffGGV_TransactionGridView.TotalsSummarySettings.SetSummaryTotalColumnCssStyle("Factored", "cffGGV_currencyCell"); cffGGV_TransactionGridView.TotalsSummarySettings.SetSummaryTotalColumnCssStyle("NonFactored", "cffGGV_currencyCell"); cffGGV_TransactionGridView.TotalsSummarySettings.SetSummaryTotalColumnCssStyle("Credit", "cffGGV_currencyCell"); cffGGV_TransactionGridView.TotalsSummarySettings.SetSummaryTotalColumnCssStyle("Receipt", "cffGGV_currencyCell"); cffGGV_TransactionGridView.TotalsSummarySettings.SetSummaryTotalColumnCssStyle("Journal", "cffGGV_currencyCell"); cffGGV_TransactionGridView.TotalsSummarySettings.SetSummaryTotalColumnCssStyle("Discount", "cffGGV_currencyCell"); cffGGV_TransactionGridView.TotalsSummarySettings.SetSummaryTotalColumnCssStyle("Repurchases", "cffGGV_currencyCell"); cffGGV_TransactionGridView.TotalsSummarySettings.SetSummaryTotalColumnCssStyle("OverPayment", "cffGGV_currencyCell"); cffGGV_TransactionGridView.CustomFooterSettings = CffCustomFooterMode.ShowTotals | CffCustomFooterMode.DefaultSettings; cffGGV_TransactionGridView.ShowFooter = true; cffGGV_TransactionGridView.AllowPaging = true; cffGGV_TransactionGridView.TotalsSummarySettings.TableClass = "dxgvFooter"; //dbb cffGGV_TransactionGridView.CustomPagerSettingsMode = CffCustomPagerMode.Rows | CffCustomPagerMode.Page | CffCustomPagerMode.FirstLast | CffCustomPagerMode.PreviousNext | CffCustomPagerMode.Bottom; cffGGV_TransactionGridView.ViewStateMode = System.Web.UI.ViewStateMode.Enabled; TransactionGridViewPH.Controls.Clear(); TransactionGridViewPH.Controls.Add(cffGGV_TransactionGridView); }