New to Telerik UI for ASP.NET Core? Download free 30-day trial
ASP.NET Core Grid Inline 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 HTML HELPER APIDescription
The Telerik UI for ASP.NET Core Data Grid supports an inline editing mode. As a result, users are able to edit the content of th eData Grid cells by simply clicking the Edit row button, then modify the data inside the cell, and, finally, save or discard the changes by using the Update or Cancel buttons.
This demo shows how to implement the inline editing feature of the Data Grid by using the create
, update
, and destroy
data operations of the component.
To enable its inline editing capabilities:
- Set
.Editable(editable => editable.Mode(GridEditMode.InLine))
. - To allow the insertion of new Data Grid records, you need to add the New Record button in the toolbar of the component—
.ToolBar(toolbar => toolbar.Create())
. - To enable the Edit and Delete commands on each row, insert a new column by setting
columns.Command(command => { command.Edit(); command.Destroy();});
. - Define the
Create
,Read
,Update
, andDestroy
action methods to theDataSource
declaration. These methods are responsible for the manipulation of the data items. - Specify a unique field in the
Model
as theDataSource.Model.Id
. - To use a custom editor for a specified column, define the editor template name through the
EditorTemplateName()
method. Add the view with the editor in the\Views\Shared\EditorTemplates
folder.
For more information about the editing capabilities, refer to the official Telerik UI for ASP.NET Core Data Grid product documentation on the available inline editing approaches.