protected void Page_Init(object sender, EventArgs e)
        {
            reportGridView                     = new CffGenGridView();
            reportGridView.PageSize            = 250;
            reportGridView.DefaultPageSize     = 250;
            reportGridView.AllowSorting        = true;
            reportGridView.AllowPaging         = true;
            reportGridView.AllowCustomPaging   = false;
            reportGridView.AutoGenerateColumns = false;
            reportGridView.ShowHeaderWhenEmpty = true;

            reportGridView.SetSortExpression = "CustomerName";
            reportGridView.EmptyDataText     = "No data to display";
            //reportGridView.CssClass = "cffGGV";
            reportGridView.HeaderStyle.CssClass          = "cffGGVHeader";
            reportGridView.AlternatingRowStyle.BackColor = System.Drawing.Color.Honeydew;
            reportGridView.EmptyDataRowStyle.CssClass    = "dxgvEmptyDataRow td";
            reportGridView.RowCssClass          = "dxgvDataRow";
            reportGridView.FooterStyle.CssClass = "dxgvFooter";
            reportGridView.Width = Unit.Percentage(68);
            reportGridView.Style.Add(HtmlTextWriterStyle.Width, "68%");
            //reportGridView.Height = Unit.Percentage(100);

            //if (((System.Web.Configuration.HttpCapabilitiesBase)(Request.Browser)).Browser == "IE")
            //    reportGridView.BorderWidth = Unit.Pixel(0);
            //else
            reportGridView.BorderWidth = Unit.Pixel(1);

            reportGridView.ShowFooter = true;
            reportGridView.TotalsSummarySettings.SetColumnTotals("Charges, ChargesWithGst, Amount, Balance");
            reportGridView.TotalsSummarySettings.SetTotalsColumnCssStyle("Charges", "cffGGV_currencyCell");
            reportGridView.TotalsSummarySettings.SetTotalsColumnCssStyle("ChargesWithGst", "cffGGV_currencyCell");
            reportGridView.TotalsSummarySettings.SetTotalsColumnCssStyle("Amount", "cffGGV_currencyCell");
            reportGridView.TotalsSummarySettings.SetTotalsColumnCssStyle("Balance", "cffGGV_currencyCell");
            reportGridView.TotalsSummarySettings.TotalsText = "Totals:";

            reportGridView.CustomFooterSettings    = CffCustomFooterMode.ShowTotals | CffCustomFooterMode.DefaultSettings;
            reportGridView.CustomPagerSettingsMode = CffCustomPagerMode.Rows | CffCustomPagerMode.Page | CffCustomPagerMode.FirstLast | CffCustomPagerMode.PreviousNext | CffCustomPagerMode.Bottom;

            reportPlaceholder.Controls.Clear();
            reportPlaceholder.Controls.Add(reportGridView);
        }
        protected void initReportGridView()
        {
            //start init parent grid
            reportGridView                 = new CffGenGridView();
            reportGridView.ID              = "reportGridView";
            reportGridView.PageSize        = 250;
            reportGridView.DefaultPageSize = 250;
            reportGridView.Width           = Unit.Percentage(100);
            reportGridView.BorderWidth     = Unit.Pixel(1);
            reportGridView.AllowSorting    = true;

            reportGridView.SetSortExpression          = "CustomerName";
            reportGridView.AutoGenerateColumns        = false;
            reportGridView.ShowHeaderWhenEmpty        = true;
            reportGridView.EmptyDataText              = "No data to display";
            reportGridView.EmptyDataRowStyle.CssClass = "dxgvEmptyDataRow td";
            reportGridView.FooterStyle.CssClass       = "dxgvFooter";
            reportGridView.EnableViewState            = true;

            //reportGridView.CssClass = "cffGGV";
            reportGridView.HeaderStyle.CssClass          = "cffGGVHeader";
            reportGridView.AlternatingRowStyle.BackColor = System.Drawing.Color.Honeydew;

            reportGridView.ShowFooter = true;
            reportGridView.TotalsSummarySettings.SetColumnTotals("CurrentBalance, MonthOldBalance, TwoMonthsOldBalance, ThreeMonthsOrOlderBalance, Balance");
            reportGridView.TotalsSummarySettings.SetTotalsColumnCssStyle("CurrentBalance", "cffGGV_currencyCell");
            reportGridView.TotalsSummarySettings.SetTotalsColumnCssStyle("MonthOldBalance", "cffGGV_currencyCell");
            reportGridView.TotalsSummarySettings.SetTotalsColumnCssStyle("TwoMonthsOldBalance", "cffGGV_currencyCell");
            reportGridView.TotalsSummarySettings.SetTotalsColumnCssStyle("ThreeMonthsOrOlderBalance", "cffGGV_currencyCell");
            reportGridView.TotalsSummarySettings.SetTotalsColumnCssStyle("Balance", "cffGGV_currencyCell");

            reportGridView.NestedSettings.Enabled = false;
            reportGridView.ViewStateMode          = System.Web.UI.ViewStateMode.Enabled;
            reportGridView.CustomFooterSettings   = CffCustomFooterMode.ShowTotals | CffCustomFooterMode.DefaultSettings;

            reportGridView.AllowPaging             = true;
            reportGridView.CustomPagerSettingsMode = CffCustomPagerMode.Page | CffCustomPagerMode.FirstLast | CffCustomPagerMode.PreviousNext | CffCustomPagerMode.Bottom | CffCustomPagerMode.Rows;

            reportPlaceholder.Controls.Clear();
            reportPlaceholder.Controls.Add(reportGridView);
        }
Ejemplo n.º 3
0
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            CffGGV_ChargesGridView                     = new CffGenGridView();
            CffGGV_ChargesGridView.ID                  = "CffGGV_ChargesGridView";
            CffGGV_ChargesGridView.AllowPaging         = false; //as suggested by marty
            CffGGV_ChargesGridView.AutoGenerateColumns = false;
            CffGGV_ChargesGridView.BorderWidth         = Unit.Pixel(1);
            CffGGV_ChargesGridView.Width               = Unit.Percentage(50);

            //CffGGV_ChargesGridView.CssClass = "cffGGV";
            CffGGV_ChargesGridView.HeaderStyle.CssClass          = "cffGGVHeader";
            CffGGV_ChargesGridView.AlternatingRowStyle.BackColor = System.Drawing.Color.Honeydew;
            CffGGV_ChargesGridView.ShowHeaderWhenEmpty           = true;
            CffGGV_ChargesGridView.EmptyDataText = "No data to display";
            CffGGV_ChargesGridView.EmptyDataRowStyle.CssClass = "dxgvEmptyDataRow td";

            GVPlaceHolder.Controls.Clear();
            GVPlaceHolder.Controls.Add(CffGGV_ChargesGridView);
        }
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            ReportGridView                            = new CffGenGridView();
            ReportGridView.PageSize                   = 250;
            ReportGridView.DefaultPageSize            = 250;
            ReportGridView.AllowSorting               = true;
            ReportGridView.AllowPaging                = true;
            ReportGridView.SetSortExpression          = "CustomerName";
            ReportGridView.AutoGenerateColumns        = false;
            ReportGridView.ShowHeaderWhenEmpty        = true;
            ReportGridView.EmptyDataText              = "No data to display";
            ReportGridView.EmptyDataRowStyle.CssClass = "dxgvEmptyDataRow td";

            //ReportGridView.CssClass = "cffGGV";
            ReportGridView.HeaderStyle.CssClass          = "cffGGVHeader";
            ReportGridView.FooterStyle.CssClass          = "dxgvFooter";
            ReportGridView.HoverRowCssClass              = "cffGGVHoverRow";
            ReportGridView.AlternatingRowStyle.BackColor = System.Drawing.Color.Honeydew;
            ReportGridView.EnableViewState = true;

            //if (((System.Web.Configuration.HttpCapabilitiesBase)(Request.Browser)).Browser == "IE")
            //    ReportGridView.BorderWidth = Unit.Pixel(0);
            //else
            ReportGridView.BorderWidth = Unit.Pixel(1);

            ReportGridView.Width         = Unit.Percentage(70);
            ReportGridView.ViewStateMode = System.Web.UI.ViewStateMode.Enabled;

            ReportGridView.ShowFooter = true;
            ReportGridView.TotalsSummarySettings.SetColumnTotals("Amount,BatchTotal");
            ReportGridView.TotalsSummarySettings.SetTotalsColumnCssStyle("Amount", "cffGGV_currencyCell");
            ReportGridView.TotalsSummarySettings.SetTotalsColumnCssStyle("BatchTotal", "cffGGV_currencyCell");
            ReportGridView.CustomFooterSettings    = CffCustomFooterMode.DefaultSettings | CffCustomFooterMode.ShowTotals;
            ReportGridView.CustomPagerSettingsMode = CffCustomPagerMode.Rows | CffCustomPagerMode.Page | CffCustomPagerMode.FirstLast | CffCustomPagerMode.PreviousNext | CffCustomPagerMode.Bottom;

            reportPlaceholder.Controls.Clear();
            reportPlaceholder.Controls.Add(ReportGridView);
        }
Ejemplo n.º 5
0
 void detailGridView_BeforePerformDataSelect(object sender, EventArgs e)
 {//HttpContext.Current.Session[this.dtKeyFieldName] = (sender as ASPxGridView).GetMasterRowKeyValue();
     try
     {
         CffGenGridView masterGrid = sender as CffGenGridView;
         //object kVal = masterGrid.GetMasterRowKeyValue();
         if (this.dataSource != null)
         {
             IList <AgedBalancesReportRecord> xABR = dataSource as IList <AgedBalancesReportRecord>;
             detailGridView.DataSource = (xABR[0] as AgedBalancesReportRecord).CustNoteList;
         }
         else
         {
             AgedBalancesReportRecord dRow = masterGrid.GetRow(masterGrid.CurrentFocusedRow) as AgedBalancesReportRecord;
             detailGridView.DataSource = dRow.CustNoteList;
         }
         detailGridView.DataBind();
     }
     catch (Exception exc) {
         string Msg = exc.Message;
     }
 }
Ejemplo n.º 6
0
        /// <summary>
        /// When implemented by a class, defines the <see cref="T:System.Web.UI.Control">
        /// </see> object that child controls and templates belong to. These child controls are in turn defined within an inline template.
        /// </summary>
        /// <param name="container">The <see cref="T:System.Web.UI.Control"></see> object to contain the instances of controls from the inline template.</param>
        void ITemplate.InstantiateIn(Control container)
        {
            TableCell tCell = (TableCell)container;

            tCell.Width       = Unit.Percentage(100);
            tCell.Height      = Unit.Percentage(100);
            tCell.BorderStyle = BorderStyle.Solid;
            tCell.BorderColor = System.Drawing.Color.LightGray;
            tCell.BorderWidth = Unit.Pixel(1);


            CffGenGridView theGrid = ((CffGenGridView)(((System.Web.UI.Control)(container)).DataKeysContainer));

            this._isFirstPage = true;
            this._isLastPage  = false;
            this._rowsCount   = theGrid.RowCount;
            this._pageSize    = theGrid.PageSize;
            this._pageCount   = (int)(this._rowsCount / this._pageSize) + (((this._rowsCount % this._pageSize) > 0) ? 1 : 0);


            tCell.DataBinding += tCell_DataBinding;
        }
Ejemplo n.º 7
0
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            cffGGV_StatementGridView                     = new CffGenGridView();
            cffGGV_StatementGridView.ID                  = "cffGGV_StatementGridView";
            cffGGV_StatementGridView.PageSize            = 1000; //displayall
            cffGGV_StatementGridView.DefaultPageSize     = 1000;
            cffGGV_StatementGridView.AllowPaging         = false;
            cffGGV_StatementGridView.AutoGenerateColumns = false;
            cffGGV_StatementGridView.SetSortExpression   = "Date";

            //if (((System.Web.Configuration.HttpCapabilitiesBase)(Request.Browser)).Browser == "IE")
            //    cffGGV_StatementGridView.BorderWidth = Unit.Pixel(0);
            //else
            cffGGV_StatementGridView.BorderWidth = Unit.Pixel(1);

            //cffGGV_StatementGridView.CssClass = "cffGGV";
            cffGGV_StatementGridView.HeaderStyle.CssClass          = "cffGGVHeader";
            cffGGV_StatementGridView.FooterStyle.CssClass          = "dxgvFooter";
            cffGGV_StatementGridView.AlternatingRowStyle.BackColor = System.Drawing.Color.Honeydew;
            cffGGV_StatementGridView.ShowHeaderWhenEmpty           = true;
            cffGGV_StatementGridView.EmptyDataText = "No data to display";
            cffGGV_StatementGridView.EmptyDataRowStyle.CssClass = "dxgvEmptyDataRow td";

            cffGGV_StatementGridView.Width = Unit.Percentage(100);

            cffGGV_StatementGridView.EnableViewState = true;
            cffGGV_StatementGridView.ShowFooter      = true;
            cffGGV_StatementGridView.TotalsSummarySettings.SetColumnTotals("Debits,Credits");
            cffGGV_StatementGridView.TotalsSummarySettings.SetTotalsColumnCssStyle("Debits", "cffGGV_rightAlignedCell");
            cffGGV_StatementGridView.TotalsSummarySettings.SetTotalsColumnCssStyle("Credits", "cffGGV_rightAlignedCell");

            cffGGV_StatementGridView.CustomFooterSettings = CffCustomFooterMode.ShowTotals | CffCustomFooterMode.DefaultSettings;

            CffGenGridViewPlaceHolder.Controls.Clear();
            CffGenGridViewPlaceHolder.Controls.Add(cffGGV_StatementGridView);
        }
Ejemplo n.º 8
0
        protected override void OnInit(EventArgs e)
        {
            CffGGV_ReportGridView = new CffGenGridView();

            CffGGV_ReportGridView.PageSize            = 250;
            CffGGV_ReportGridView.DefaultPageSize     = 250;
            CffGGV_ReportGridView.AllowPaging         = true;
            CffGGV_ReportGridView.AutoGenerateColumns = true;
            CffGGV_ReportGridView.AllowPaging         = true;

            //CffGGV_ReportGridView.CssClass = "cffGGV";
            CffGGV_ReportGridView.HeaderStyle.CssClass       = "cffGGVHeader";
            CffGGV_ReportGridView.ShowHeaderWhenEmpty        = true;
            CffGGV_ReportGridView.EmptyDataText              = "No data to display";
            CffGGV_ReportGridView.EmptyDataRowStyle.CssClass = "dxgvEmptyDataRow td";

            //if (((System.Web.Configuration.HttpCapabilitiesBase)(Request.Browser)).Browser == "IE")
            //    CffGGV_ReportGridView.BorderWidth = Unit.Pixel(0);
            //else
            CffGGV_ReportGridView.BorderWidth = Unit.Pixel(1);

            GridViewReportPanel.Controls.Add(CffGGV_ReportGridView);
        }
        protected override void OnInit(EventArgs e)
        {
            CffGGV_CreditsClaimedGridView                     = new CffGenGridView();
            CffGGV_CreditsClaimedGridView.AllowPaging         = false; //removed as suggested
            CffGGV_CreditsClaimedGridView.AutoGenerateColumns = false;
            CffGGV_CreditsClaimedGridView.SetSortExpression   = "tranref";
            CffGGV_CreditsClaimedGridView.BorderWidth         = Unit.Pixel(1);

            CffGGV_CreditsClaimedGridView.HeaderStyle.CssClass       = "cffGGVHeader";
            CffGGV_CreditsClaimedGridView.ShowHeaderWhenEmpty        = true;
            CffGGV_CreditsClaimedGridView.EmptyDataText              = "No data to display";
            CffGGV_CreditsClaimedGridView.EmptyDataRowStyle.CssClass = "dxgvEmptyDataRow td";

            CffGGV_CreditsClaimedGridView.ShowFooter = true;
            CffGGV_CreditsClaimedGridView.TotalsSummarySettings.SetColumnTotals("Amount, Sum");
            CffGGV_CreditsClaimedGridView.TotalsSummarySettings.SetTotalsColumnCssStyle("Amount", "cffGGV_currencyCell");
            CffGGV_CreditsClaimedGridView.TotalsSummarySettings.SetTotalsColumnCssStyle("Sum", "cffGGV_currencyCell");
            CffGGV_CreditsClaimedGridView.CustomFooterSettings = CffCustomFooterMode.ShowTotals | CffCustomFooterMode.DefaultSettings;
            //CffGGV_CreditsClaimedGridView.CustomPagerSettingsMode = CffCustomPagerMode.Page | CffCustomPagerMode.Rows | CffCustomPagerMode.FirstLast | CffCustomPagerMode.PreviousNext;

            CCGridViewPlaceHolder.Controls.Clear();
            CCGridViewPlaceHolder.Controls.Add(CffGGV_CreditsClaimedGridView);
        }
        protected void Page_Init(object sender, EventArgs e)
        {
            ReportGridView                            = new CffGenGridView();
            ReportGridView.ID                         = "CffGGV_CustomerTrxReportGridView";
            ReportGridView.PageSize                   = 250;
            ReportGridView.DefaultPageSize            = 250; // added by dbb
            ReportGridView.BorderWidth                = Unit.Pixel(1);
            ReportGridView.AllowSorting               = true;
            ReportGridView.SetSortExpression          = "CustomerName";
            ReportGridView.AutoGenerateColumns        = false;
            ReportGridView.ShowHeaderWhenEmpty        = true;
            ReportGridView.EmptyDataText              = "No data to display";
            ReportGridView.EmptyDataRowStyle.CssClass = "dxgvEmptyDataRow td";

            ReportGridView.HeaderStyle.CssClass          = "cffGGVHeader";
            ReportGridView.FooterStyle.CssClass          = "dxgvFooter";
            ReportGridView.AlternatingRowStyle.BackColor = System.Drawing.Color.Honeydew;
            ReportGridView.Width = Unit.Percentage(70);

            ReportGridView.CustomPagerSettingsMode = CffCustomPagerMode.Bottom | CffCustomPagerMode.Rows | CffCustomPagerMode.FirstLast | CffCustomPagerMode.PreviousNext;
            RptPlaceHolder.Controls.Clear();
            RptPlaceHolder.Controls.Add(ReportGridView);
        }
Ejemplo n.º 11
0
        protected override void OnInit(EventArgs e)
        {
            CreditsGridView                     = new CffGenGridView();
            CreditsGridView.PageSize            = 1000;
            CreditsGridView.AllowPaging         = false;
            CreditsGridView.AutoGenerateColumns = false;
            CreditsGridView.ShowHeaderWhenEmpty = true;
            CreditsGridView.ShowFooter          = true;
            CreditsGridView.EmptyDataText       = "No data to display";

            //CreditsGridView.CssClass = "cffGGV";
            CreditsGridView.HeaderStyle.CssClass          = "cffGGVHeader";
            CreditsGridView.AlternatingRowStyle.BackColor = System.Drawing.Color.Honeydew;
            CreditsGridView.EmptyDataRowStyle.CssClass    = "dxgvEmptyDataRow td";

            //if (((System.Web.Configuration.HttpCapabilitiesBase)(Request.Browser)).Browser == "IE")
            //    CreditsGridView.BorderWidth = Unit.Pixel(0);
            //else
            CreditsGridView.BorderWidth = Unit.Pixel(1);

            CCGridViewPlaceHolder.Controls.Clear();
            CCGridViewPlaceHolder.Controls.Add(CreditsGridView);
        }
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            reportGridView                     = new CffGenGridView();
            reportGridView.PageSize            = 250;
            reportGridView.DefaultPageSize     = 250;
            reportGridView.AllowSorting        = true;
            reportGridView.EnableSortGraphic   = true;
            reportGridView.SetSortExpression   = "CustomerName";
            reportGridView.AutoGenerateColumns = false;
            reportGridView.ShowHeaderWhenEmpty = true;
            reportGridView.EmptyDataText       = "No data to display";

            //reportGridView.CssClass = "cffGGV";
            reportGridView.HeaderStyle.CssClass          = "cffGGVHeader";
            reportGridView.FooterStyle.CssClass          = "dxgvFooter";
            reportGridView.AlternatingRowStyle.BackColor = System.Drawing.Color.Honeydew;
            reportGridView.EmptyDataRowStyle.CssClass    = "dxgvEmptyDataRow td";

            //if (((System.Web.Configuration.HttpCapabilitiesBase)(Request.Browser)).Browser == "IE")
            //    reportGridView.BorderWidth = Unit.Pixel(0);
            //else
            reportGridView.Width = Unit.Percentage(80);
            //reportGridView.Style.Add(HtmlTextWriterStyle.Width, "80%");
            reportGridView.BorderWidth = Unit.Pixel(1);

            reportGridView.ShowFooter = true;
            reportGridView.TotalsSummarySettings.SetColumnTotals("Balance");
            reportGridView.TotalsSummarySettings.SetTotalsColumnCssStyle("Balance", "cffGGV_rightAlignedCell");
            reportGridView.CustomFooterSettings    = CffCustomFooterMode.ShowTotals | CffCustomFooterMode.DefaultSettings;
            reportGridView.CustomPagerSettingsMode = CffCustomPagerMode.Rows | CffCustomPagerMode.Page | CffCustomPagerMode.FirstLast | CffCustomPagerMode.PreviousNext | CffCustomPagerMode.Bottom;
            //reportGridView.Width = Unit.Percentage(100);

            reportPlaceholder.Controls.Clear();
            reportPlaceholder.Controls.Add(reportGridView);
        }
        protected override void divLeft_DataBinding(object sender, EventArgs e)
        {
            CffGenGridView gV    = null;
            GridViewRow    gvRow = null;

            HtmlContainerControl divLeft = (HtmlContainerControl)sender;

            var context = DataBinder.GetDataItem(divLeft.NamingContainer);

            if ((Cff.SaferTrader.Web.UserControls.gGridViewControls.CffGenGridView)(divLeft.NamingContainer.BindingContainer) != null)
            {
                gV    = (Cff.SaferTrader.Web.UserControls.gGridViewControls.CffGenGridView)(divLeft.NamingContainer.BindingContainer);
                gvRow = ((System.Web.UI.WebControls.GridViewRow)(divLeft.Controls[0].BindingContainer));
            }

            if (this.DataField == "emailReceipt")
            {
                Label label = new Label();
                label.ControlStyle.CssClass = this._textCss;

                foreach (EmailReceiptType rt in Enum.GetValues(typeof(EmailReceiptType)))
                {
                    if (Convert.ToInt16(DataBinder.Eval(context, DataField)) == (int)rt)
                    {
                        label.Text = rt.ToString();
                    }
                }

                divLeft.Controls.Add(label);
            }


            else
            {
                //implement other dropdown types here
            }
        }
Ejemplo n.º 14
0
        protected override void OnInit(EventArgs e)
        {
            RepurchasesGridView                     = new CffGenGridView();
            RepurchasesGridView.BorderWidth         = Unit.Pixel(1); //modified by dbb
            RepurchasesGridView.AutoGenerateColumns = false;
            RepurchasesGridView.ShowHeaderWhenEmpty = true;

            //RepurchasesGridView.CssClass = "cffGGV";
            RepurchasesGridView.HeaderStyle.CssClass          = "cffGGVHeader";
            RepurchasesGridView.AlternatingRowStyle.BackColor = System.Drawing.Color.Honeydew;
            RepurchasesGridView.EmptyDataRowStyle.CssClass    = "dxgvEmptyDataRow td";
            RepurchasesGridView.EmptyDataText              = "No data to display";
            RepurchasesGridView.EnableViewState            = true;
            RepurchasesGridView.EmptyDataRowStyle.CssClass = "dxgvEmptyDataRow td";

            RepurchasesGridView.Columns.Clear();
            RepurchasesGridView.InsertDataColumn("#", "CustomerNumber", CffGridViewColumnType.Text, "3%", "cffGGV_leftAlignedCell", HorizontalAlign.Left, HorizontalAlign.Left, true);
            RepurchasesGridView.InsertBoundHyperLinkColumn("Customer", "CustomerName", "CustomerId", "10%", "cffGGV_leftAlignedCell", HorizontalAlign.Left, HorizontalAlign.Left);
            RepurchasesGridView.InsertDataColumn("Transaction", "TransactionNumber", CffGridViewColumnType.Text, "3%", "cffGGV_leftAlignedCell", HorizontalAlign.Left, HorizontalAlign.Left, true);
            RepurchasesGridView.InsertDataColumn("Dated", "Dated", CffGridViewColumnType.Date, "5%", "cffGGV_leftAlignedCell", HorizontalAlign.Left, HorizontalAlign.Left, true);
            RepurchasesGridView.InsertCurrencyColumn("Amount", "Amount", "6%", "cffGGV_currencyCell", false, HorizontalAlign.Right, HorizontalAlign.Right);
            RepurchasesGridView.InsertBoundHyperLinkColumn("Batch", "Batch", "Batch", "4%", "cffGGV_HyperLinkLeftPW10", HorizontalAlign.Left, HorizontalAlign.Left, "", "cffGGVHeaderLeftAgedBal2");
            RepurchasesGridView.InsertDataColumn("Created", "Created", CffGridViewColumnType.Date, "5%", "cffGGV_leftAlignedCell", HorizontalAlign.Left, HorizontalAlign.Left, true);

            RepurchasesGridView.ShowFooter = true;
            RepurchasesGridView.TotalsSummarySettings.SetColumnTotals("Amount");
            RepurchasesGridView.TotalsSummarySettings.SetTotalsColumnCssStyle("Amount", "cffGGV_currencyCell");
            RepurchasesGridView.CustomFooterSettings = CffCustomFooterMode.ShowTotals | CffCustomFooterMode.DefaultSettings;
            RepurchasesGridView.ViewStateMode        = System.Web.UI.ViewStateMode.Enabled;

            RepurchasesGridView.Width  = Unit.Percentage(50);
            RepurchasesGridView.Height = Unit.Percentage(100);

            GVPlaceHolder.Controls.Clear();
            GVPlaceHolder.Controls.Add(RepurchasesGridView);
        }
Ejemplo n.º 15
0
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            ReportGridView = new CffGenGridView();

            ReportGridView.AllowSorting            = true;
            ReportGridView.AllowCustomPaging       = false;
            ReportGridView.RowStyleHighlightColour = System.Drawing.Color.Honeydew;

            ReportGridView.SetSortExpression   = "CustomerName";
            ReportGridView.AutoGenerateColumns = false;
            ReportGridView.ShowHeaderWhenEmpty = true;
            ReportGridView.EmptyDataText       = "No data to display";
            //ReportGridView.CssClass = "cffGGV";
            ReportGridView.HeaderStyle.CssClass          = "cffGGVHeader";
            ReportGridView.FooterStyle.CssClass          = "dxgvFooter";
            ReportGridView.HoverRowCssClass              = "cffGGVHoverRow";
            ReportGridView.AlternatingRowStyle.BackColor = System.Drawing.Color.Honeydew;
            ReportGridView.EmptyDataRowStyle.CssClass    = "dxgvEmptyDataRow td";
            ReportGridView.Width       = Unit.Percentage(80);
            ReportGridView.BorderWidth = Unit.Pixel(1);

            ReportGridView.AllowPaging     = false;
            ReportGridView.PageSize        = 1000;
            ReportGridView.DefaultPageSize = 1000;

            ReportGridView.EnableViewState = true;
            ReportGridView.ShowFooter      = true;
            ReportGridView.TotalsSummarySettings.SetColumnTotals("Amount,BatchTotal");
            ReportGridView.TotalsSummarySettings.SetTotalsColumnCssStyle("Amount", "cffGGV_currencyCell");
            ReportGridView.TotalsSummarySettings.SetTotalsColumnCssStyle("BatchTotal", "cffGGV_currencyCell");
            ReportGridView.CustomFooterSettings = CffCustomFooterMode.ShowTotals | CffCustomFooterMode.DefaultSettings;
            reportPlaceholder.Controls.Clear();
            reportPlaceholder.Controls.Add(ReportGridView);
        }
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            LikelyRepurchasesGridView    = new CffGenGridView();
            LikelyRepurchasesGridView.ID = "LikelyRepurchasesGridView";
            LikelyRepurchasesGridView.HeaderStyle.CssClass          = "cffGGVHeader";
            LikelyRepurchasesGridView.AlternatingRowStyle.BackColor = System.Drawing.Color.Honeydew;

            LikelyRepurchasesGridView.AutoGenerateColumns        = false;
            LikelyRepurchasesGridView.ShowHeaderWhenEmpty        = true;
            LikelyRepurchasesGridView.EmptyDataText              = "No data to display";
            LikelyRepurchasesGridView.EmptyDataRowStyle.CssClass = "dxgvEmptyDataRow td";
            LikelyRepurchasesGridView.EnableViewState            = true;

            LikelyRepurchasesGridView.PageSize    = 1000;
            LikelyRepurchasesGridView.ShowFooter  = true;
            LikelyRepurchasesGridView.AllowPaging = false; //removed as suggested
            LikelyRepurchasesGridView.Width       = Unit.Percentage(70);
            //LikelyRepurchasesGridView.CustomPagerSettingsMode = CffCustomPagerMode.Rows | CffCustomPagerMode.Page | CffCustomPagerMode.FirstLast | CffCustomPagerMode.PreviousNext | CffCustomPagerMode.Bottom;
            LikelyRepurchasesGridView.ViewStateMode = System.Web.UI.ViewStateMode.Enabled;

            likelyRepurchasesPlaceHolder.Controls.Clear();
            likelyRepurchasesPlaceHolder.Controls.Add(LikelyRepurchasesGridView);
        }
Ejemplo n.º 17
0
        protected void Page_Init(object sender, EventArgs e)
        {
            notesGridView                     = new CffGenGridView();
            notesGridView.PageSize            = 250;
            notesGridView.AllowSorting        = true;
            notesGridView.AutoGenerateColumns = false;
            notesGridView.EnableViewState     = true;

            notesGridView.BorderWidth          = Unit.Pixel(1);
            notesGridView.CssClass             = "cffGGVPrintReports";
            notesGridView.HeaderStyle.CssClass = "cffGGV_PrintReportHeader";

            notesGridView.HeaderStyle.BackColor         = System.Drawing.Color.FromArgb(237, 237, 237);
            notesGridView.AlternatingRowStyle.BackColor = System.Drawing.Color.AliceBlue;
            notesGridView.BorderStyle = System.Web.UI.WebControls.BorderStyle.Solid;
            notesGridView.BorderColor = System.Drawing.Color.AliceBlue;
            notesGridView.BorderWidth = System.Web.UI.WebControls.Unit.Point(1);

            notesGridView.ShowFooter = true;
            notesGridView.CustomPagerSettingsMode = CffCustomPagerMode.Rows | CffCustomPagerMode.Page | CffCustomPagerMode.FirstLast | CffCustomPagerMode.PreviousNext;
            notesGridView.Width = Unit.Percentage(55);

            notesGridViewPlaceHolder.Controls.Add(notesGridView);
        }
        protected override void divLeft_DataBinding(object sender, EventArgs e)
        {
            CffGenGridView gV    = null;
            GridViewRow    gvRow = null;

            HtmlContainerControl divLeft = (HtmlContainerControl)sender;
            var context = DataBinder.GetDataItem(divLeft.NamingContainer);

            //divLeft.ID = "TDIV_" + divLeft.NamingContainer.ID;

            if ((Cff.SaferTrader.Web.UserControls.gGridViewControls.CffGenGridView)(divLeft.NamingContainer.BindingContainer) != null)
            {
                gV    = (Cff.SaferTrader.Web.UserControls.gGridViewControls.CffGenGridView)(divLeft.NamingContainer.BindingContainer);
                gvRow = ((System.Web.UI.WebControls.GridViewRow)(divLeft.Controls[0].BindingContainer));
            }

            if ((gV != null) && gV.IsInEditMode && (gV.EditIndex == gvRow.RowIndex) && (gV.EditingMode == CffGridViewEditingMode.InLine))
            {
                //if is in editmode and edit index == current row and is inline edit
                HtmlGenericControl LineBreak = new HtmlGenericControl("br");
                HtmlGenericControl par       = new HtmlGenericControl("p");

                TextBox TBox    = new TextBox();
                String  strText = "";
                if (DataBinder.Eval(context, DataField) != null)
                {
                    strText = DataBinder.Eval(context, DataField) == null
                        ? ""
                        : DataBinder.Eval(context, DataField).ToString();
                    TBox.Text = strText;
                }
                else
                {
                    TBox.Text = "";
                }

                TBox.ID = "Tbx" + DataField;

                TBox.CssClass = "cffGV_CellTextBox";
                TBox.Style.Add(HtmlTextWriterStyle.BorderStyle, "none");
                TBox.Style.Add(HtmlTextWriterStyle.Width, "100%");

                TBox.Width    = Unit.Percentage(100);
                TBox.Height   = Unit.Pixel(100);
                TBox.TextMode = TextBoxMode.MultiLine;
                //TBox.CssClass = "maxPopupScreenWidth";
                TBox.Attributes.Add("runat", "server");
                TBox.Attributes.Add("Rows", "100");

                TBox.Wrap         = true;
                TBox.Enabled      = !this.ReadOnly;
                TBox.AutoPostBack = false;

                Label label = new Label();
                //label.ControlStyle.Width = Unit.Pixel((DataHeader.Length + 1) * 2);  //dbb
                label.ControlStyle.Width    = Unit.Pixel((DataHeader.Length) * 2);
                label.ControlStyle.CssClass = "cffGGV_CellLabel";
                label.Style.Add(HtmlTextWriterStyle.Margin, "0px 0px 0px 0px;");

                label.Text = DataHeader + ": ";
                par.Controls.Add(label);
                par.Controls.Add(LineBreak);
                par.Controls.Add(TBox);

                par.Style.Add(HtmlTextWriterStyle.Padding, "0px 0px 0px 0px;");
                par.Style.Add(HtmlTextWriterStyle.Margin, "0px 0px 0px 0px;");
                par.Attributes.Add("align", "left");

                divLeft.Controls.Add(par);
                divLeft.Style.Add(HtmlTextWriterStyle.Width, "100%");
                divLeft.Style.Add(HtmlTextWriterStyle.Height, "150px");
                divLeft.Style.Add(HtmlTextWriterStyle.Padding, "0px 0px 0px 0px");
                divLeft.Style.Add(HtmlTextWriterStyle.Margin, "0px 0px 0px 0px");
                gvRow.Height = Unit.Pixel(150);
            }
            else
            {
                HtmlGenericControl MemoPar = new HtmlGenericControl("p");
                MemoPar.Attributes.CssStyle.Value = this._textCss;
                MemoPar.Attributes.Add("readonly", "true");
                MemoPar.Style.Add(HtmlTextWriterStyle.TextAlign, "justify");
                MemoPar.Style.Add(HtmlTextWriterStyle.BorderWidth, "0px");
                MemoPar.Style.Add(HtmlTextWriterStyle.BorderColor, "none");
                MemoPar.Style.Add(HtmlTextWriterStyle.MarginTop, "5px");
                MemoPar.Style.Add(HtmlTextWriterStyle.MarginBottom, "5px");
                MemoPar.Style.Add(HtmlTextWriterStyle.MarginLeft, "6px");
                MemoPar.Style.Add(HtmlTextWriterStyle.MarginRight, "10px");
                MemoPar.Style.Add(HtmlTextWriterStyle.BackgroundColor, "transparent");

                double rows = 1;
                double initRows;
                double finalRows;
                double preCol   = 0;
                double finalCol = 0;

                if (DataBinder.Eval(context, DataField) != null)
                {
                    System.Text.StringBuilder strText = new System.Text.StringBuilder("");
                    strText = new System.Text.StringBuilder(CffGenGridViewCommon.FormatDataColumn(this._columnType, DataBinder.Eval(context, DataField) == null ? "" : DataBinder.Eval(context, DataField).ToString()));
                    strText.Replace("<br />", " ");

                    if (!string.IsNullOrEmpty(strText.ToString()))
                    {
                        MemoPar.InnerText = strText.ToString();

                        if (strText.Length > 120)      //*todo: do a dynamic way of getting the max length
                        {
                            if (strText.Length >= 150) //*todo: find a way dynamically adjust row column grids based on the length of memo data
                            {
                                initRows  = ((double)(strText.Length / 130.00));
                                finalRows = Math.Round(initRows, 2) + 1;
                                rows      = finalRows;
                                string rowDec   = rows.ToString();
                                string rowsFDec = rowDec.Substring(rowDec.Length - 1, 1);
                                int    rowDisp  = int.Parse(rowsFDec);
                                if (rowDisp > 0)
                                {
                                    rows = rows + 1;
                                }
                                preCol   = (strText.Length / finalRows);
                                finalCol = (preCol + (130 - preCol)) - 10;
                                MemoPar.Attributes.Add("cols", strText.Length >= 120 ? "130" : finalCol.ToString());
                                //MemoPar.Attributes.Add("cols", finalCol.ToString());
                            }
                            else
                            {
                                MemoPar.Attributes.Add("cols", "115");
                                rows = ((int)(strText.Length / 115)) + 1;
                            }
                        }
                        else
                        {
                            MemoPar.Attributes.Add("cols", "120");
                            rows = ((int)(strText.Length) / 120);   // 50 - dbb
                        }

                        if (rows <= 0)
                        {
                            rows = 1;
                        }
                        MemoPar.Attributes.Add("rows", rows.ToString());
                    }
                    else
                    {
                        MemoPar.Attributes.Add("rows", "0");
                        MemoPar.Attributes.Add("cols", "140");
                    }
                }
                else
                {
                    MemoPar.Attributes.Add("rows", "0");
                    MemoPar.Attributes.Add("cols", "140");
                }
                MemoPar.Attributes.Add("wrap", "hard");   // dbb [20160804]
                MemoPar.Style.Add(HtmlTextWriterStyle.FontSize, "12px");
                MemoPar.Style.Add(HtmlTextWriterStyle.FontFamily, "Tahoma, Arial, Helvetica, sans-serif");
                MemoPar.Style.Add(HtmlTextWriterStyle.Overflow, "hidden");
                //if (rows < 6) { MemoPar.Style.Add(HtmlTextWriterStyle.Overflow, "hidden"); }  //dbb
                divLeft.Controls.Add(MemoPar);
                //divLeft.Style.Add(HtmlTextWriterStyle.Width, "100%");
            }
        }
        public override void Export()
        {
            AgedBalancesReport report = ViewState["AgedBalancesReport"] as AgedBalancesReport;

            System.Collections.Generic.IList <AgedBalancesReportRecord> exportRecordWithNotes = new System.Collections.Generic.List <AgedBalancesReportRecord>();

            foreach (AgedBalancesReportRecord rptRecord in report.Records)
            {
                System.Collections.Generic.IList <CustomerNote> cnList = rptRecord.CustNoteList;
                rptRecord.Note = "";
                foreach (CustomerNote cNote in cnList)
                {
                    if (!string.IsNullOrEmpty(cNote.Comment))
                    {
                        rptRecord.Note += "[" + cNote.CreatedByEmployeeName + "][" + cNote.Created.ToShortDateString() + "]";
                        rptRecord.Note += cNote.Comment + System.Environment.NewLine;
                    }
                }

                if (!string.IsNullOrEmpty(rptRecord.Note))
                {
                    rptRecord.CustNoteList.Clear();
                }

                exportRecordWithNotes.Add(rptRecord);
            }

            //init columns
            CffGenGridView exportGrid = this.reportGridView;

            if (this.isReportWithNotes)
            {
                exportGrid.AllowSorting      = true;
                exportGrid.SetSortExpression = "CustomerName";
                exportGrid.InsertDataColumn("Customer", "CustomerName");
                exportGrid.InsertCurrencyColumn("Current", "CurrentBalance");
                exportGrid.InsertCurrencyColumn("Month 1", "MonthOldBalance");
                exportGrid.InsertCurrencyColumn("Month 2", "TwoMonthsOldBalance");
                exportGrid.InsertCurrencyColumn("Month 3+", "ThreeMonthsOrOlderBalance");
                exportGrid.InsertCurrencyColumn("Balance", "Balance");
                exportGrid.InsertDataColumn("Next Call", "NextCallDate", CffGridViewColumnType.Date, "10%", "cffGGV_centerAlignedCell", HorizontalAlign.Center, HorizontalAlign.Center, true);
                exportGrid.InsertDataColumn("Note", "Note");
                exportGrid.Visible = false;

                exportGrid.InsertDataColumn("Email", "Email");
                exportGrid.InsertDataColumn("Contact", "Contact");
                exportGrid.InsertDataColumn("Phone", "Phone");
                exportGrid.InsertDataColumn("Mobile Phone", "Cell");
                exportGrid.TotalsSummarySettings.SetColumnTotals("CurrentBalance, MonthOldBalance, TwoMonthsOldBalance, ThreeMonthsOrOlderBalance, Balance");
                exportGrid.CustomFooterSettings = CffCustomFooterMode.ShowTotals | CffCustomFooterMode.DefaultSettings;

                exportGrid.DataSource = exportRecordWithNotes;
                exportGrid.DataBind();
            }


            if (report != null)
            {
                ExcelDocument document = new ExcelDocument();
                document._HSFFGetSheet.SetColumnWidth(8, 400);
                document.WriteTitle(report.Title);

                if (IsReportWithNotesLiteral.Text.ToLower() == "true")
                {
                    exportGrid.WriteToExcelDocument(document);
                }
                else
                {
                    reportGridView.WriteToExcelDocument(document);
                }

                document.MoveToNextRow();
                document.MoveToNextRow();
                document.AddCell("Date Viewed");
                document.AddCell(report.DateViewed.ToDateTimeString());

                WriteToResponse(document.WriteToStream(), report.ExportFileName);
            }
        }
Ejemplo n.º 20
0
 void detailGridView_DataBound(object sender, EventArgs e)
 { //Template
     CffGenGridView dGrid = sender as CffGenGridView;
 }
Ejemplo n.º 21
0
        void tCell_DataBinding(object sender, EventArgs e)
        {
            TableCell      tCell   = (TableCell)sender;
            CffGenGridView theGrid = ((CffGenGridView)(((System.Web.UI.Control)(sender)).DataKeysContainer));

            if (this._pageCount <= 0)
            {
                this._pageCount  = 1;
                this._isLastPage = true;
            }

            if (theGrid.DataSource != null)
            {
                this._rowsCount = ((IEnumerable)theGrid.DataSource).Cast <object>().ToList().Count();

                if (this._rowsCount <= this._pageSize)
                {
                    this._isFirstPage = true;
                    this._isLastPage  = true;
                }
                else
                {
                    this._isLastPage = false;
                }

                if (theGrid.AllowGroupBy)
                {
                    CffCustomPagerGroupSettings xSettings = theGrid.CustomPagerGroupedBySettings;
                    this._groupedRowCount  = xSettings.GroupedRowCount;
                    this._groupedPageCount = (xSettings.PageCount > 0) ? xSettings.PageCount : 1;
                    this._isGroupedBy      = true;
                }
            }

            Literal space = new Literal();

            space.Text = "&nbsp;";

            //start pager settings rendering
            TableRow PagerTableRow = new TableRow();

            if (theGrid.CustomPagerSettingsMode.HasFlag(CffCustomPagerMode.Rows))
            { //select number of rows per page
                TableCell tCellRowsPerPage = new TableCell();
                tCellRowsPerPage.Width = Unit.Percentage(25);

                Label lb = new Label();
                lb.Text = "Rows Per Page: ";
                lb.ID   = "lb_" + tCell.ID;
                tCellRowsPerPage.Controls.Add(lb);

                int          i;
                int          max             = (this._rowsCount < 50) ? this._rowsCount : 50;
                const int    increment       = 5;
                bool         alreadySelected = false;
                DropDownList _ddlPageSize    = new DropDownList();
                _ddlPageSize.ToolTip = "Select number of rows per page";

                ListItem item;
                for (i = increment; i <= max; i += increment)
                {
                    item = new ListItem(i.ToString());
                    if (i == this._pageSize)
                    {
                        item.Selected   = true;
                        alreadySelected = true;
                    }
                    _ddlPageSize.Items.Add(item);
                }

                item = new ListItem("All", this._rowsCount.ToString());
                if (this._rowsCount == this._pageSize && alreadySelected == false)
                {
                    item.Selected   = true;
                    alreadySelected = true;
                }

                if (this._rowsCount > (i - increment) && alreadySelected == false)
                {
                    item.Selected = true;
                }

                //_ddlPageSize.AutoPostBack = true;
                _ddlPageSize.Items.Add(item);
                _ddlPageSize.Attributes.Add("runat", "server");
                _ddlPageSize.SelectedIndexChanged += new EventHandler(_ddlPageSize_SelectedIndexChanged);

                tCellRowsPerPage.Controls.Add(_ddlPageSize);
                PagerTableRow.Cells.Add(tCellRowsPerPage);
            }

            TableCell tCellNoRecords = new TableCell();

            tCellNoRecords.Width = Unit.Percentage(25);
            Label recordsLabel = new Label();

            if (this._isGroupedBy)
            {
                recordsLabel.Text = String.Format("Found {0} grouped record{1} out of {2}.", this._groupedRowCount, (this._groupedRowCount <= 1) ? String.Empty : "s", this._rowsCount);
            }
            else
            {
                recordsLabel.Text = String.Format("Found {0} record{1}.", this._rowsCount, (this._rowsCount <= 1) ? String.Empty : "s");
            }
            recordsLabel.Style.Add(HtmlTextWriterStyle.PaddingLeft, "30px");
            tCellNoRecords.Controls.Add(recordsLabel);
            PagerTableRow.Cells.Add(tCellNoRecords);


            if (theGrid.CustomPagerSettingsMode.HasFlag(CffCustomPagerMode.Page))
            {
                TableCell tCellPageSelect = new TableCell();
                tCellPageSelect.Width = Unit.Percentage(25);

                Label lbl = new Label();
                lbl.Text = "Page";
                lbl.Style.Add(HtmlTextWriterStyle.PaddingRight, "3px");
                tCellPageSelect.Controls.Add(lbl);
                tCellPageSelect.Controls.Add(space);

                txtBoxPage.ToolTip   = "Enter page number";
                txtBoxPage.MaxLength = 4;
                txtBoxPage.Width     = Unit.Pixel(30);
                txtBoxPage.Style.Add(HtmlTextWriterStyle.MarginLeft, "10px");
                txtBoxPage.Style.Add(HtmlTextWriterStyle.MarginRight, "10px");

                txtBoxPage.Text = (theGrid.PageIndex + 1).ToString();

                //txtBoxPage.AutoPostBack = true;
                txtBoxPage.Attributes.Add("runat", "server");
                txtBoxPage.TextChanged += new EventHandler(txtBoxPage_TextChanged);
                tCellPageSelect.Controls.Add(txtBoxPage);

                if (this._pageCount == 1)
                {
                    txtBoxPage.Enabled = false;
                }
                else
                {
                    txtBoxPage.Enabled = true;
                }

                lbl = new Label();
                //if (this._isGroupedBy)
                //    lbl.Text = String.Format(" of {0} ", this._groupedPageCount);
                //else
                lbl.Text = String.Format(" of {0} ", this._pageCount);
                lbl.Style.Add(HtmlTextWriterStyle.PaddingRight, "20px");
                tCellPageSelect.Controls.Add(lbl);
                PagerTableRow.Cells.Add(tCellPageSelect);
            }

            //Render Buttons
            HtmlGenericControl divRight = new HtmlGenericControl("div");

            divRight.InnerText = "";
            divRight.ID        = "divRight_" + tCell.ID;
            divRight.Style.Add("float", "right");
            divRight.Style.Add(HtmlTextWriterStyle.PaddingRight, "1px");
            divRight.Style.Add(HtmlTextWriterStyle.Width, "100%");
            divRight.Style.Add(HtmlTextWriterStyle.TextAlign, "right");

            //add first button
            if (theGrid.CustomPagerSettingsMode.HasFlag(CffCustomPagerMode.FirstLast))
            {
                btnFirst.Text            = "<<";
                btnFirst.CommandName     = "Page";
                btnFirst.CommandArgument = "First";

                btnFirst.Enabled = !this._isFirstPage;
                if (theGrid.IsRowCommandPostBack)
                {
                    if (theGrid.PageIndex == 1)
                    {
                        this.btnFirst.Enabled = false;
                    }
                }

                if (btnFirst.Enabled)
                {
                    btnFirst.ToolTip = "First page";
                }
                btnFirst.Visible = true;

                btnFirst.Attributes.Add("runat", "server");
                btnFirst.CausesValidation  = false;
                btnFirst.UseSubmitBehavior = false;

                divRight.Controls.Add(space);
                divRight.Controls.Add(btnFirst);
            }

            //add previous and next buttons
            if (theGrid.CustomPagerSettingsMode.HasFlag(CffCustomPagerMode.PreviousNext))
            {
                btnPrev.Text            = "<";
                btnPrev.CommandName     = "Page";
                btnPrev.CommandArgument = "Prev";

                btnPrev.Enabled = !this._isFirstPage;
                if (theGrid.IsRowCommandPostBack)
                {
                    if (theGrid.PageIndex == 1)
                    {
                        this.btnPrev.Enabled = false;
                    }
                }

                if (btnPrev.Enabled)
                {
                    btnPrev.ToolTip = "Previous page";
                }
                btnPrev.Visible = true;

                btnPrev.UseSubmitBehavior = true;
                btnPrev.CausesValidation  = false;
                btnPrev.Attributes.Add("runat", "server");

                divRight.Controls.Add(space);
                divRight.Controls.Add(btnPrev);

                //todo: setting usesubmitbehavior = false posts back to the page where the datagrid is rendered and actually bypasses RowCommand event
                btnNext.Text            = ">";
                btnNext.CommandName     = "Page"; //"Next:
                btnNext.CommandArgument = "Next";

                btnNext.Enabled = !this._isLastPage;
                if (theGrid.IsRowCommandPostBack)
                {
                    if (theGrid.PageIndex == 1)
                    {
                        this.btnNext.Enabled = false;
                    }
                }

                if (btnNext.Enabled)
                {
                    btnNext.ToolTip = "Next page";
                }
                btnNext.Visible = true;

                btnNext.Attributes.Add("runat", "server");
                btnNext.UseSubmitBehavior = true;
                btnNext.CausesValidation  = false;
                btnNext.Click            += btnNext_Click;

                divRight.Controls.Add(space);
                divRight.Controls.Add(btnNext);
            }
            //add last button

            //add first button
            if (theGrid.CustomPagerSettingsMode.HasFlag(CffCustomPagerMode.FirstLast))
            {
                btnLast.Text            = ">>";
                btnLast.CommandName     = "Page";
                btnLast.CommandArgument = "Last";

                if (theGrid.IsRowCommandPostBack)
                {
                    if (theGrid.PageIndex == 1)
                    {
                        this.btnLast.Enabled = false;
                    }
                }

                if (btnLast.Enabled)
                {
                    btnLast.ToolTip = "Last page";
                }
                btnLast.Visible = true;

                btnLast.UseSubmitBehavior = false;
                btnLast.CausesValidation  = false;
                btnLast.Attributes.Add("runat", "server");
                btnLast.Enabled = !this._isLastPage;

                divRight.Controls.Add(space);
                divRight.Controls.Add(btnLast);
            }


            TableCell tCellPagerButtons = new TableCell();

            tCellPagerButtons.Style.Add(HtmlTextWriterStyle.Width, "auto");
            tCellPagerButtons.Controls.Add(divRight);
            PagerTableRow.Cells.Add(tCellPagerButtons);

            Table PagerTable = new Table();

            PagerTable.Width = Unit.Percentage(100);
            PagerTable.Rows.Add(PagerTableRow);

            tCell.Controls.Add(PagerTable);
        }
        protected override void divLeft_DataBinding(object sender, EventArgs e)
        {
            HtmlContainerControl divLeft = (HtmlContainerControl)sender;
            var context = DataBinder.GetDataItem(divLeft.NamingContainer);
            //divLeft.ID = "TDIV_" + divLeft.NamingContainer.ID;

            CffGenGridView gV    = (Cff.SaferTrader.Web.UserControls.gGridViewControls.CffGenGridView)(divLeft.NamingContainer.BindingContainer);
            GridViewRow    gvRow = ((System.Web.UI.WebControls.GridViewRow)(divLeft.Controls[0].BindingContainer));

            if ((gV != null) && (gV.IsInEditMode) && (gV.EditIndex == gvRow.RowIndex) && (gV.EditingMode == CffGridViewEditingMode.InLine))
            { //if is in editmode and edit index == current row and is inline edit
                HtmlGenericControl LineBreak = new HtmlGenericControl("br");
                HtmlGenericControl par       = new HtmlGenericControl("p");

                TextBox TBox = new TextBox();
                if (DataBinder.Eval(context, DataField) != null)
                {
                    TBox.Text = DataBinder.Eval(context, DataField) == null ? "" : DataBinder.Eval(context, DataField).ToString();
                }
                else
                {
                    TBox.Text = "";
                }

                TBox.ID = "Tbx" + DataField;
                TBox.ControlStyle.CssClass = "cffGV_CellTextBox";
                TBox.Style.Add(HtmlTextWriterStyle.BorderStyle, "none");

                TBox.Visible      = true;
                TBox.ReadOnly     = this.ReadOnly;
                TBox.Enabled      = !this.ReadOnly;
                TBox.AutoPostBack = this.ReadOnly;;

                Label label = new Label();
                label.ControlStyle.Width    = Unit.Pixel((DataHeader.Length + 1) * 2);
                label.ControlStyle.CssClass = "cffGGV_CellLabel";
                label.Style.Add(HtmlTextWriterStyle.BorderStyle, "none");
                label.Style.Add(HtmlTextWriterStyle.Margin, "0px 0px 0px 0px;");

                label.Text = DataHeader + ":";
                par.Controls.Add(label);
                par.Controls.Add(LineBreak);
                par.Controls.Add(TBox);
                par.Style.Add(HtmlTextWriterStyle.Padding, "0px 0px 0px 0px;");
                par.Style.Add(HtmlTextWriterStyle.Margin, "0px 0px 0px 0px;");
                par.Attributes.Add("align", "left");

                divLeft.Controls.Add(par);
                divLeft.Style.Add(HtmlTextWriterStyle.Width, "100%");
                divLeft.Style.Add(HtmlTextWriterStyle.Height, "150px");
                divLeft.Style.Add(HtmlTextWriterStyle.Padding, "0px 0px 0px 0px");
                divLeft.Style.Add(HtmlTextWriterStyle.Margin, "0px 0px 0px 0px");
                gvRow.Height = Unit.Pixel(150);
            }
            else
            {
                Label label = new Label();
                label.ControlStyle.CssClass = this._textCss;
                try {
                    label.Text = "";
                    if (this._columnType == CffGridViewColumnType.Date)
                    {
                        object o = DataBinder.Eval(context, DataField);
                        if (DataBinder.Eval(context, DataField) != null)
                        {
                            if (o != null)
                            {
                                label.Text = o.ToString();
                            }
                            else
                            {
                                label.Text = CffGenGridViewCommon.FormatDataColumn(this._columnType, DataBinder.Eval(context, DataField) == null ? "" : DataBinder.Eval(context, DataField).ToString());
                            }
                        }
                    }
                    else if (this._columnType == CffGridViewColumnType.DateTime)   // added by dbb
                    {
                        object ct = context.GetType().GetProperty("Created").GetValue(context, null);
                        object dt = ct.GetType().GetProperty("DateTime").GetValue(ct, null);

                        label.Text = CffGenGridViewCommon.FormatDataColumn(this._columnType, DataBinder.Eval(context, DataField) == null ? "" : dt.ToString());
                    }
                    else
                    {
                        if (DataBinder.Eval(context, DataField) != null)
                        {
                            label.Text = CffGenGridViewCommon.FormatDataColumn(this._columnType, DataBinder.Eval(context, DataField) == null ? "" : DataBinder.Eval(context, DataField).ToString());
                        }
                    }
                } catch (Exception exc) {
                    label.Text = exc.Message;
                }

                label.ControlStyle.BorderWidth = Unit.Pixel(0);
                if (this._columnType == CffGridViewColumnType.Currency)
                {
                    label.ControlStyle.CssClass = "cffGGV_currencyCell";
                }

                divLeft.Controls.Add(label);
            }
        }
Ejemplo n.º 23
0
        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);
        }