Ejemplo n.º 1
0
        private void FillGridStatus()
        {
            try
            {
                //if (m_sBuyerId == "") { grdDemand.DataSource = null; return; }
                DataTable dtBind = new DataTable();
                dtBuyer  = new DataTable();
                dtStatus = new DataTable();
                DataSet ds = new DataSet();
                ds = ProgBillBL.GetDemandAgeStatus(m_iFromDays, m_iToDays, m_iCCId);
                //dtStatus = ds.Tables[0];
                //dtBuyer = ds.Tables[1];
                //dtBind = ds.Tables[2];
                dtStatus = ds.Tables[1];

                //DataView dv = new DataView(dtBind);
                //dv.RowFilter = "LeadId In(" + m_sBuyerId.TrimEnd(',') + ")";
                //dtBind = dv.ToTable();
                grdDemand.DataSource = null;
                grdDemand.DataSource = dtStatus;

                grdViewDemand.PopulateColumns();
                grdDemand.ForceInitialize();

                grdViewDemand.Columns["PBillId"].Visible      = false;
                grdViewDemand.Columns["CostCentreId"].Visible = false;
                grdViewDemand.Columns["FlatId"].Visible       = false;
                grdViewDemand.Columns["PaySchId"].Visible     = false;
                //grdViewDemand.Columns["FlatNo"].Visible = false;
                grdViewDemand.Columns["LeadId"].Visible   = false;
                grdViewDemand.Columns["NoOfDays"].Visible = false;

                //grdViewDemand.Columns["BillNo"].Width = 50;
                //grdViewDemand.Columns["PBDate"].Width = 50;
                //grdViewDemand.Columns["FlatNo"].Width = 50;
                //grdViewDemand.Columns["BuyerName"].Width = 100;
                //grdViewDemand.Columns["Description"].Width = 200;
                //grdViewDemand.Columns["SentDate"].Width = 50;
                //grdViewDemand.Columns["Count"].Width = 30;
                //grdViewDemand.Columns["Sel"].Width = 30;

                grdViewDemand.Columns["FlatNo"].Caption = CommFun.m_sFuncName + " No";

                //grdViewDemand.Columns["BuyerName"].Width = 200;
                //grdViewDemand.Columns["SentDate"].Width = 100;
                //grdViewDemand.Columns["Count"].Width = 100;
                //grdViewDemand.Columns["Sel"].Width = 50;

                grdViewDemand.Columns["Count"].AppearanceHeader.TextOptions.HAlignment    = DevExpress.Utils.HorzAlignment.Far;
                grdViewDemand.Columns["NoOfDays"].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far;
                grdViewDemand.Columns["Sel"].AppearanceCell.Options.UseTextOptions        = true;
                grdViewDemand.Columns["Sel"].AppearanceCell.TextOptions.HAlignment        = DevExpress.Utils.HorzAlignment.Center;
                grdViewDemand.Columns["Sel"].AppearanceHeader.Options.UseTextOptions      = true;
                grdViewDemand.Columns["Sel"].AppearanceHeader.TextOptions.HAlignment      = DevExpress.Utils.HorzAlignment.Center;

                grdViewDemand.OptionsSelection.InvertSelection = true;
                grdViewDemand.OptionsSelection.EnableAppearanceHideSelection = false;
                grdViewDemand.Appearance.FocusedRow.BackColor = Color.Teal;
                grdViewDemand.Appearance.FocusedRow.ForeColor = Color.White;
                grdViewDemand.BestFitColumns();
            }
            catch (Exception ex)
            {
                BsfGlobal.CustomException(ex.Message, ex.StackTrace);
            }
        }