Editing in ASP.NET Core Tree Grid Component

18 Nov 20181 minute to read

The TreeGrid component has options to dynamically insert, delete and update records. Editing feature is enabled by using e-treegrid-editSettings tag helper and it requires a primary key column for CRUD operations.

To define the primary key, set isPrimaryKey of e-treegrid-column tag helper to true in particular column.

NOTE

You can disable editing for a particular column, by specifying allowEditing of e-treegrid-column tag helper to false.

Toolbar with edit option

The treegrid toolbar has the built-in items to execute Editing actions. You can define this by using the toolbar property.

Adding row position

The TreeGrid control provides the support to add the new row in the top, bottom, above selected row, below selected row and child position of tree grid content using newRowPosition property of e-treegrid-editsettings tag helper. By default, a new row will be added at the top of the treegrid.

The following examples shows how to set new row position as Child in treegrid.

Confirmation messages

Delete confirmation

The delete confirm dialog can be shown when deleting a record by defining the showDeleteConfirmDialog as true.

NOTE

The showDeleteConfirmDialog supports all type of edit modes.

Default column values on add new

The treegrid provides an option to set the default value for the columns when adding a new record in it. To set a default value for the particular column by defining the defaultValue in e-treegrid-column tag helper.

Disable editing for particular column

You can disable editing for particular columns by using the allowEditing property of e-treegrid-column tag helper.

In the following demo, editing is disabled for the Start Date column.

Troubleshoot: Editing works only for first row

The Editing functionalities can be performed based upon the primary key value of the selected row. If isPrimaryKey is not defined in the treegrid, then edit or delete action take places the first row.

NOTE

You can refer to our ASP.NET Core Tree Grid feature tour page for its groundbreaking feature representations. You can also explore our ASP.NET Core Tree Grid example ASP.NET Core Tree Grid example to knows how to present and manipulate data.