Data Grid WinForms Control Create data gird view in C# with modern user interface for your Windows Forms applications C# Grid MaskBox Column
The Kettic Data Grid Control uses the Data Grid Column objects to represent columns. The Kettic Data Grid Column is the base class of all types of grid columns, including the Grid MaskBox Column. The Grid MaskBox Column descends all features of the Kettic Data Grid Column parent class. So the Grid MaskBox Column shares all properties of Data Grid Control class and provides styling and C# events for building entire gird MaskBox column in Windows Forms C# applications. Add Grid MaskBox Column in C#
The Kettic Grid MaskBox Column is used to edit text data in restricted format. To display the text, we need to set text to the Value property based on the settings of properties, like TextAlignment, WrapText, and FormatString. To add a mask to the grid maskbox column, we can customize the Mask and MaskType properties using the C# code snippet below. GridMaskBoxColumn maskBoxColumn = new GridMaskBoxColumn(); maskBoxColumn.Name = "Product"; maskBoxColumn.FieldName = "ProductPrice"; maskBoxColumn.HeaderText = "Product Price"; maskBoxColumn.MaskType = MaskType.Numeric; maskBoxColumn.Mask = "C"; maskBoxColumn.TextAlignment = ContentAlignment.BottomCenter; maskBoxColumn.FormatString = "{0:C}"; maskBoxColumn.DataType = typeof(decimal); ketticGrid.MasterTemplate.Columns.Add(maskBoxColumn);
|