New to Telerik UI for WinForms? Download free 30-day trial


GridViewTextBoxColumn displays and allows editing of text data. Each cell in GridViewTextBoxColumn column displays the text of cell Value property according to the settings of the TextAlignment (default is ContentAlignment.MiddleLeft) and WrapText(default is false) properties. The displayed text is formatted according to the value of the FormatString property.

When a user begins editing a cell, a textbox editor is provided to handle the user’s input. The length of the text the user can enter is restricted to the value of MaxLength property.

WinForms RadGridView GridViewTextBoxColumn

Add GridViewTextBoxColumn to the grid.

GridViewTextBoxColumn textBoxColumn = new GridViewTextBoxColumn();
textBoxColumn.Name = "TextBoxColumn";
textBoxColumn.HeaderText = "Product Name";
textBoxColumn.FieldName = "ProductName";
textBoxColumn.MaxLength = 50;
textBoxColumn.TextAlignment = ContentAlignment.BottomRight;

Dim textBoxColumn As New GridViewTextBoxColumn()
textBoxColumn.Name = "TextBoxColumn"
textBoxColumn.HeaderText = "Product Name"
textBoxColumn.FieldName = "ProductName"
textBoxColumn.MaxLength = 50
textBoxColumn.TextAlignment = ContentAlignment.BottomRight

Character casing

GridViewTextBoxColumn editor - RadTextBoxEditor - supports character casing. To enable this functionality you need to set ColumnCharecterCasing property of the desired GridViewTextBoxColumn column:

((GridViewTextBoxColumn)this.radGridView1.Columns[0]).ColumnCharacterCasing = CharacterCasing.Upper;

DirectCast(Me.RadGridView1.Columns(0), GridViewTextBoxColumn).ColumnCharacterCasing = CharacterCasing.Upper

ColumnCarecterCasing property affects only the editor and does not change the values in your data base. For instance, if your data base contains text which is lower case or partially lower case, and you set the ColumnCharacterCasing to upper case, the data will not be change. However, if the user starts editing a cell, the editor will only allow upper case symbols and all lower case symbols will be converted to upper case ones.

See Also

In this article