New to Telerik UI for ASP.NET Core? Download free 30-day trial
ASP.NET Core 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 Core Data Grid not only to visualize data in a table structure, but also to support editing and validation before users save changes.
The Telerik UI for ASP.NET Core Grid allows you to implement CRUD data-editing operations by setting its data source.
To enable the data-editing capabilities of the component:
- Set the
Editable
configuration property of the Grid—.Editable(editable => editable.Mode(GridEditMode.InCell))
. - Declare the field definitions of the Data Grid through the
Model
configurator. - Configure the DataSource of the Data Grid for performing CRUD data operations by defining its
Read
,Create
,Update
, andDestroy
methods. - To allow the insertion of new Data Grid records, enable the relevant option in the toolbar of the component—
.ToolBar(toolbar => toolbar.Create())
. - To allow the deletion of Data Grid items, include a Delete command column.
This demo shows how to define a custom validation rule by setting the CustomValidationProductViewModel
model and the productnamevalidation
function. You can force a check for a first capital letter on the Product Name column when you edit the value in it.
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.