Edit this page


GridViewMaskBoxColumn allows restricted editing of text data. Each cell in GridViewMaskBoxColumn column displays the text of the cell Value property according to the settings of the TextAlignment (default is ContentAlignment.MiddleLeft), WrapText (default is false) and FormatString properties.

gridview-columns-gridviewmaskboxcolumn 001

You can set a mask to GridViewMaskBoxColumn using its Mask and MaskType properties. You can find further information about the possible values for these properties in RadMaskEditBox documentation section.


You can use FormatString property to format the values of GridViewMaskBoxColumn cells not currently opened for editing.

Add GridViewMaskBoxColumn to the grid.

GridViewMaskBoxColumn maskBoxColumn = new GridViewMaskBoxColumn();
maskBoxColumn.Name = "Price";
maskBoxColumn.FieldName = "UnitPrice";
maskBoxColumn.HeaderText = "Unit Price";
maskBoxColumn.MaskType = MaskType.Numeric;
maskBoxColumn.Mask = "C";
maskBoxColumn.TextAlignment = ContentAlignment.BottomRight;
maskBoxColumn.FormatString = "{0:C}";
maskBoxColumn.DataType = typeof(decimal);

Dim maskBoxColumn As New GridViewMaskBoxColumn()
maskBoxColumn.Name = "Price"
maskBoxColumn.FieldName = "UnitPrice"
maskBoxColumn.HeaderText = "Unit Price"
maskBoxColumn.MaskType = MaskType.Numeric
maskBoxColumn.Mask = "C"
maskBoxColumn.TextAlignment = ContentAlignment.BottomRight
maskBoxColumn.FormatString = "{0:C}"
maskBoxColumn.DataType = GetType(Decimal)

See Also

Is this article helpful? Yes / No
Thank you for your feedback!

Give article feedback

Tell us how we can improve this article