New to Telerik UI for ASP.NET Core? Download free 30-day trial

ASP.NET Core Grid Custom Validator Editing

Loading Demo...
  • EXAMPLE
  • VIEW SOURCE
  • Edit in Telerik REPL
HtmlHelper
TagHelper
Files:
editing_custom_validation.cshtml
Editing_Custom_ValidationController.cs
ProductService.cs
CustomValidationProductViewModel.cs
Editing_Custom_Validation_TagHelper.cshtml

Also available for:

CLIENT-SIDE API HTML HELPER API

Description

Some scenarios require the Telerik UI for ASP.NET Core 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 Core Data Grid product documentation on the available data-editing approaches.

Additional Apps

This Grid example is part of unique collection of hundreds of ASP.NET Core demos, with which you can see all Telerik ASP.NET Core components and their features in action. View the source code of the demos from the library or directly adapt, and edit them and their theme appearance in Telerik REPL for ASP.NET Core or ThemeBuilder.

Support & Learning Resources

Additional Resources