Ejemplo n.º 1
0
        private void LoadDataGrid()
        {
            dgvCustomerLedger.DataSource = applicationFacade.GetCustomerLedgers().OrderBy(s => s.CustomerLedgerName).ToList();
            ExtensionMethods.SetGridDefaultProperty(dgvCustomerLedger);

            dgvCustomerLedger.Columns["CustomerLedgerCode"].Visible    = true;
            dgvCustomerLedger.Columns["CustomerLedgerCode"].HeaderText = "Ledger Code";

            dgvCustomerLedger.Columns["CustomerLedgerName"].Visible    = true;
            dgvCustomerLedger.Columns["CustomerLedgerName"].HeaderText = "Ledger Name";

            dgvCustomerLedger.Columns["CustomerLedgerShortName"].Visible    = true;
            dgvCustomerLedger.Columns["CustomerLedgerShortName"].HeaderText = "Ledger ShortName";

            dgvCustomerLedger.Columns["Address"].Visible    = true;
            dgvCustomerLedger.Columns["Address"].HeaderText = "Address";

            dgvCustomerLedger.Columns["Mobile"].Visible    = true;
            dgvCustomerLedger.Columns["Mobile"].HeaderText = "Mobile";

            dgvCustomerLedger.Columns["EmailAddress"].Visible    = true;
            dgvCustomerLedger.Columns["EmailAddress"].HeaderText = "Email Address";

            dgvCustomerLedger.Columns["OpeningBal"].Visible    = true;
            dgvCustomerLedger.Columns["OpeningBal"].HeaderText = "Opening Bal";

            dgvCustomerLedger.Columns["CreditDebit"].Visible    = true;
            dgvCustomerLedger.Columns["CreditDebit"].HeaderText = "CreditDebit";

            dgvCustomerLedger.Columns["StatusText"].Visible    = true;
            dgvCustomerLedger.Columns["StatusText"].HeaderText = "Status";

            //Change order
            dgvCustomerLedger.Columns["StatusText"].DisplayIndex = dgvCustomerLedger.ColumnCount - 1;

            txtSearch_TextChanged(null, null);
        }