Esempio n. 1
0
        public void FillData()
        {
            m_bLayOut = false;

            grdReceipt.DataSource = null;

            dt = new DataTable();
            dt = ReceiptDetailBL.GetReceiptRegister();
            if (dt == null)
            {
                return;
            }

            Cursor.Current = Cursors.WaitCursor;

            grdReceipt.DataSource = dt;
            grdReceipt.ForceInitialize();
            grdViewReceipt.PopulateColumns();
            grdViewReceipt.Columns["ReceiptId"].Visible = false;
            grdViewReceipt.Columns["ReceiptId"].OptionsColumn.ShowInCustomizationForm = false;
            grdViewReceipt.Columns["Narration"].Visible = false;

            grdViewReceipt.Columns["ReceiptDate"].Width   = 50;
            grdViewReceipt.Columns["ReceiptDate"].Caption = "Ref. Date";
            grdViewReceipt.Columns["ReceiptDate"].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
            grdViewReceipt.Columns["ReceiptDate"].AppearanceCell.TextOptions.HAlignment   = DevExpress.Utils.HorzAlignment.Near;

            grdViewReceipt.Columns["ReceiptNo"].Width   = 60;
            grdViewReceipt.Columns["ReceiptNo"].Caption = "Ref. No";
            grdViewReceipt.Columns["ReceiptNo"].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
            grdViewReceipt.Columns["ReceiptNo"].AppearanceCell.TextOptions.HAlignment   = DevExpress.Utils.HorzAlignment.Near;

            grdViewReceipt.Columns["CostCentreId"].Visible = false;
            grdViewReceipt.Columns["CostCentreId"].OptionsColumn.ShowInCustomizationForm = false;

            grdViewReceipt.Columns["BuyerName"].Width   = 150;
            grdViewReceipt.Columns["BuyerName"].Caption = "Buyer";
            grdViewReceipt.Columns["BuyerName"].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
            grdViewReceipt.Columns["BuyerName"].AppearanceCell.TextOptions.HAlignment   = DevExpress.Utils.HorzAlignment.Near;

            grdViewReceipt.Columns["FlatNo"].Width   = 80;
            grdViewReceipt.Columns["FlatNo"].Caption = CommFun.m_sFuncName + " No";
            grdViewReceipt.Columns["FlatNo"].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
            grdViewReceipt.Columns["FlatNo"].AppearanceCell.TextOptions.HAlignment   = DevExpress.Utils.HorzAlignment.Near;

            grdViewReceipt.Columns["CostCentreName"].Width   = 170;
            grdViewReceipt.Columns["CostCentreName"].Caption = "Project";
            grdViewReceipt.Columns["CostCentreName"].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
            grdViewReceipt.Columns["CostCentreName"].AppearanceCell.TextOptions.HAlignment   = DevExpress.Utils.HorzAlignment.Near;

            grdViewReceipt.Columns["Amount"].Width = 70;
            grdViewReceipt.Columns["Amount"].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far;
            grdViewReceipt.Columns["Amount"].AppearanceCell.TextOptions.HAlignment   = DevExpress.Utils.HorzAlignment.Far;
            grdViewReceipt.Columns["Amount"].SummaryItem.SummaryType    = DevExpress.Data.SummaryItemType.Sum;
            grdViewReceipt.Columns["Amount"].SummaryItem.DisplayFormat  = BsfGlobal.g_sDigitFormatS;
            grdViewReceipt.Columns["Amount"].DisplayFormat.FormatType   = DevExpress.Utils.FormatType.Numeric;
            grdViewReceipt.Columns["Amount"].DisplayFormat.FormatString = BsfGlobal.g_sDigitFormat;

            grdViewReceipt.Columns["PaymentAgainst"].Width   = 100;
            grdViewReceipt.Columns["PaymentAgainst"].Caption = "Pay Type";
            grdViewReceipt.Columns["PaymentAgainst"].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
            grdViewReceipt.Columns["PaymentAgainst"].AppearanceCell.TextOptions.HAlignment   = DevExpress.Utils.HorzAlignment.Near;

            grdViewReceipt.Columns["Approve"].Width = 80;
            grdViewReceipt.Columns["Approve"].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
            grdViewReceipt.Columns["Approve"].AppearanceCell.TextOptions.HAlignment   = DevExpress.Utils.HorzAlignment.Center;

            grdViewReceipt.Columns["ChequeDisbursement"].Width = 100;
            grdViewReceipt.Columns["ChequeDisbursement"].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
            grdViewReceipt.Columns["ChequeDisbursement"].AppearanceCell.TextOptions.HAlignment   = DevExpress.Utils.HorzAlignment.Center;

            grdViewReceipt.OptionsBehavior.AllowIncrementalSearch = true;
            grdViewReceipt.OptionsView.ShowAutoFilterRow          = true;
            grdViewReceipt.FocusedRowHandle = 0;
            grdViewReceipt.FocusedColumn    = grdViewReceipt.VisibleColumns[0];

            grdViewReceipt.OptionsSelection.InvertSelection = true;
            grdViewReceipt.OptionsSelection.EnableAppearanceHideSelection = false;
            grdViewReceipt.Appearance.FocusedRow.BackColor = Color.Teal;
            grdViewReceipt.Appearance.FocusedRow.ForeColor = Color.White;

            BsfGlobal.RestoreLayout("CRMReceiptRegister", grdViewReceipt);
            m_bLayOut = true;

            Cursor.Current = Cursors.Default;
        }