DataGridTextBoxColumn maxlength

while adding tablestyles to a datagrid how do i set the max length of the column.

1 Reply

CB Clay Burch Syncfusion Team July 27, 2002 07:01 AM UTC

If you are adding DataGridTextBoxColumn objects to your DataGridTableStyle, then you can set the MaxLength property on the TextBox property of the DataGridTextBoxColumn.
' Add a second column style.
  Dim TextCol As DataGridTextBoxColumn
  TextCol = New DataGridTextBoxColumn()
  TextCol.MappingName = "custName"
  TextCol.HeaderText = "Customer Name"
  TextCol.Width = 250
  TextCol.TextBox.MaxLength = 8 'max 8 chars
  ts1.GridColumnStyles.Add(TextCol)

Loader.
Up arrow icon