Please see my other Telerik articles.
Customizing an input field within a grid
In this article I’ll demonstrate how to customize a grid’s input field.
Within the grid I have a field: FederalTaxID.
A requirement was added to enforce this field’s unique format and provide the user a helpful hint as the enter data.
First, I’ll define a partial view to define the layout for this field and use it to provide a helpful hint to the user.
Note: This partial view must be saved in Views\Shared\EditorTemplates.
Next, within the View Model used by the grid, I’ll update the property with a regular expression which requires the special format and provides a helpful error message if the user violates the requirement.
Finally, I’ll update the grid to use a template for the editor defined earlier.
Now, my grid provides the user a helpful hint below the text box regarding the expected format and validates the special format for this field or provides a helpful error message.