This is a migrated thread and some comments may be shown as answers.

Max length in batch edit mode

1 Answer 33 Views
Grid
This is a migrated thread and some comments may be shown as answers.
miksh
Top achievements
Rank 1
Iron
miksh asked on 07 Mar 2017, 04:18 PM

How to set a max length validation to a DataBound column in the batch edit mode?

E.g. in your demo http://demos.telerik.com/aspnet-ajax/grid/examples/data-editing/batch-editing/defaultcs.aspx if you enter a long product name it will fail with "Product with ID 76 cannot be updated. Reason: String or binary data would be truncated. The statement has been terminated."

I tied to set MaxLength but it doesn't work

<telerik:GridBoundColumn UniqueName="ProductName"
   DataField="ProductName" MaxLength="40"
   HeaderText="Product Name">
</telerik:GridBoundColumn>

1 Answer, 1 is accepted

Sort by
0
Mike
Top achievements
Rank 2
answered on 07 Aug 2017, 09:29 AM

I assume by the lack of replies that there is no built-in solution for this using the MaxLength attribute with Batch editing?

I can achieve the client-side functionality by setting a ColumnEditorID for the column and setting the TextBoxMaxLength attribute on the editor, but that obviously isn't an ideal solution for multiple columns with different text lengths.

Tags
Grid
Asked by
miksh
Top achievements
Rank 1
Iron
Answers by
Mike
Top achievements
Rank 2
Share this question
or