New to Telerik UI for ASP.NET Core? Start a free 30-day trial
Editing
The OrgChart provides a built-in editing functionality, which is enabled by default.
Editing allows you to:
- Modify node data.
- Upload a new image that will be used as node avatar. The size of the uploaded image cannot exceed 1MB.
- Modify the OrgChart hierarchy by selecting a different parent for the edited node.
Editing Configuration
To send the new data to the server, configure CRUD operations in the OrgChart DataSource. If this configuration is missing, the OrgChart will work with the updated data on the client.
The following example demonstrates how to configure the OrgChart to use editing.
Razor
@(Html.Kendo().OrgChart<Kendo.Mvc.Examples.Models.OrgChartEmployeeViewModel>()
.Name("orgchart")
.DataSource(dataSource => dataSource
.Read(read => read.Action("Read", "OrgChart"))
.Create(read => read.Action("Create", "OrgChart"))
.Destroy(read => read.Action("Destroy", "OrgChart"))
.Update(read => read.Action("Update", "OrgChart"))
.Model(m => {
m.Id(f => f.ID);
m.ParentId(f => f.ParentID);
m.Name(f => f.Name);
m.Title(f => f.Title);
m.Avatar(f => f.Avatar);
m.Expanded(f=>f.Expanded);
})
)
)
Disable the Editing
For disabling the Edit functionality set the Editable
configuration to false
:
Razor
.Editable(false)