Exemplo n.º 1
0
        private void FillCarPark()
        {
            dtCP = new DataTable();
            dtCP = UnitDirBL.GetCar(m_iTypeId, m_iCCId);
            grdCar.DataSource = dtCP;

            grdViewCar.Columns["BlockId"].Visible = false;

            grdViewCar.Columns["BlockName"].OptionsColumn.ReadOnly     = true;
            grdViewCar.Columns["AllottedSlots"].OptionsColumn.ReadOnly = true;
            //grdViewCar.Columns["NoOfSlots"].OptionsColumn.ReadOnly = false;

            grdViewCar.Columns["BlockName"].OptionsColumn.AllowEdit     = false;
            grdViewCar.Columns["AllottedSlots"].OptionsColumn.AllowEdit = false;
            //grdViewCar.Columns["NoOfSlots"].OptionsColumn.AllowEdit = true;

            grdViewCar.Columns["AllottedSlots"].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far;
            grdViewCar.Columns["NoOfSlots"].AppearanceHeader.TextOptions.HAlignment     = DevExpress.Utils.HorzAlignment.Far;

            RepositoryItemButtonEdit txtAmtEdit = new RepositoryItemButtonEdit();

            grdViewCar.Columns["NoOfSlots"].ColumnEdit = txtAmtEdit;
            txtAmtEdit.TextEditStyle = TextEditStyles.DisableTextEditor;

            txtAmtEdit.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Numeric;
            txtAmtEdit.Mask.EditMask = "########################";
            txtAmtEdit.Mask.UseMaskAsDisplayFormat = true;
            txtAmtEdit.Validating  += txtAmtEdit_Validating;
            txtAmtEdit.DoubleClick += txtAmtEdit_DoubleClick;

            grdViewCar.OptionsSelection.InvertSelection = false;
            grdViewCar.OptionsSelection.EnableAppearanceHideSelection = false;
            grdViewCar.Appearance.FocusedRow.BackColor = Color.Teal;
            grdViewCar.Appearance.FocusedRow.ForeColor = Color.White;
            grdViewCar.BestFitColumns();
        }