New to Telerik UI for ASP.NET MVC? Download free 30-day trial
ASP.NET MVC Grid Custom Validator Editing
- EXAMPLE
- VIEW SOURCE
-
Change Theme
defaultDefault Theme
- Main
- Main Dark
- Nordic
- Ocean Blue
- Ocean Blue A11Y
- Purple
- Turquoise
Bootstrap Theme- Main
- Bootstrap 3
- Bootstrap 3 Dark
- Main Dark
- Nordic
- Turquoise
- Turquoise Dark
- Urban
- Vintage
Material Theme- Main
- Arctic
- Lime Dark
- Main Dark
- Nova
Classic Theme- Main
- Green
- Green Dark
- Lavender
- Lavender Dark
- Main Dark
- Metro
- Metro Dark
- Moonlight
- Opal
- Opal Dark
- Silver
- Silver Dark
- Uniform
Fluent Theme- Main
Also available for:
CLIENT-SIDE API SERVER-SIDE APIDescription
Some scenarios require the Telerik UI for ASP.NET MVC Data Grid not only to visualize data in a table structure, but also to support editing and validation before users save changes.
By design, the Grid has a built-in Validator that is initialized when a specified row is in edit mode. Each property that binds to an editable Grid column is validated based on how it is defined in the Model. For example, if the field is required, if its data type is correct, and more. You can extend the default validation rules of the Grid's Validator and perform additional client-side validations.
This demo shows how to extend the Grid built-in Validator and define a custom validation rule by using the jQuery extend() method. The productnamevalidation()
function checks for a first capital letter of the ProductName field column when editing.
For more information about the editing capabilities, refer to the official Telerik UI for ASP.NET MVC Data Grid product documentation on the available data-editing approaches.