private void AddSubPanel1() { GridPanel panel = superGridControl1.FindGridPanel("GridPanel1", true); if (panel != null) { GridMaskedTextBoxEditControl mtb = panel.Columns["MaskedTextBox"].EditControl as GridMaskedTextBoxEditControl; if (mtb != null) { mtb.Mask = "(000)-000-0000"; } foreach (GridRow row in panel.Rows) { object[] data = GetGridPanel1RowData(); for (int i = 0; i < data.Length; i++) { row.Cells[i].Value = data[i]; } } } }
/// <summary> /// Initializes the default state of the grid /// </summary> private void InitializeGrid() { GridPanel panel = superGridControl1.PrimaryGrid; string[] orderArray = { "Asterids", "Eudicots", "Rosids" }; // Set the ComboBoxEx column EditorType to our FragrantComboBox // and set the EditorParams to our created orderArray. // // The EditorParams property holds the parameters that will be // sent to the like defined EditorControl constructor when the // grid creates the EditControl. The EditorParams can be any // array of objects, but must match in type and order to the // associated constructor. panel.Columns["ComboBoxEx"].EditorType = typeof(FragrantComboBox); panel.Columns["ComboBoxEx"].EditorParams = new object[] { orderArray }; // Set the ButtonX column EditorType to our FlowerButton // and set the EditorParams to our created flowerImageList. panel.Columns["ButtonX"].EditorType = typeof(FlowerButton); panel.Columns["ButtonX"].EditorParams = new object[] { flowerImageList }; // Enable the Clear button on the TextBoxDropDown edit control GridTextBoxDropDownEditControl ddc = panel.Columns["TextBoxDropDown"].EditControl as GridTextBoxDropDownEditControl; if (ddc != null) { ddc.ButtonClear.Visible = true; ddc.ButtonClearClick += DdcButtonClearClick; } // Set the Mask on the MaskedTextBox edit control GridMaskedTextBoxEditControl mtb = panel.Columns["MaskedTextBox"].EditControl as GridMaskedTextBoxEditControl; if (mtb != null) { mtb.Mask = ">LL->L-000"; } // Now lets change the DirtyMarkerBackground on every // other row - just to demonstrate the operation for (int i = 0; i < panel.Rows.Count; i++) { if (i % 2 == 0) { GridRow row = (GridRow)panel.Rows[i]; row.RowStyles.Default.RowHeaderStyle.DirtyMarkerBackground = new Background(Color.Crimson, Color.Gainsboro, BackFillType.VerticalCenter); } } }
public Rmax_values() { InitializeComponent(); //center form Rectangle rect = Screen.PrimaryScreen.WorkingArea; this.Top = (rect.Height / 2) - (this.Height / 2); this.Left = (rect.Width / 2) - (this.Width / 2); GridPanel panel = gridRmax.PrimaryGrid; GridMaskedTextBoxEditControl mtb = panel.Columns["rmax"].EditControl as GridMaskedTextBoxEditControl; mtb.Mask = "00.00"; }