Hi,
I have a editable TreeGrid version 14.2.0.26.
When I add a new
record, I want to set the values in the new row, like a parent Id or like a sequential number.
Is it possibile? thanks
A solution exists for Grid as in
https://www.syncfusion.com/forums/123345/editable-grid-values-in-new-recordBut
actionBegin event is not called for TreeGrid
.@(Html.EJ().TreeGrid("Editing")
.Datasource(ds => ds.Json((IEnumerable<MyObject>)ViewBag.dataSource).UpdateURL("ObjectsUpdate").InsertURL("ObjectsInsert").RemoveURL("ObjectsDelete").Adaptor(AdaptorType.RemoteSaveAdaptor))
.EnableResize()
.ShowColumnChooser(true)
.AllowSorting(true)
.EditSettings(edit => {
edit.AllowAdding().AllowDeleting().AllowEditing();
edit.EditMode(TreeGridEditMode.CellEditing);
edit.RowPosition(TreeGridRowPosition.Child);
})
.ToolbarSettings(toolbar =>
{
toolbar.ShowToolbar().ToolbarItems(new List<TreeGridToolBarItems>()
{
TreeGridToolBarItems.Add,
TreeGridToolBarItems.Edit,
TreeGridToolBarItems.Delete,
TreeGridToolBarItems.Update,
TreeGridToolBarItems.Cancel,
TreeGridToolBarItems.ExpandAll,
TreeGridToolBarItems.CollapseAll
});
})
.ChildMapping("Children")
.TreeColumnIndex(1)
.Columns(col =>
{
col.Field("Id").HeaderText("ID объекта").AllowEditing(false).EditType(TreeGridEditingType.Numeric).Width(90).Add();
col.Field("Name").HeaderText("Наименование").Width(270).EditType(TreeGridEditingType.String).Add();
col.Field("IdParent").HeaderText("ID родительского объекта").AllowEditing(false).EditType(TreeGridEditingType.Numeric).Width(90).Add();
col.Field("SortOrder").HeaderText("Порядок сортировки").EditType(TreeGridEditingType.Numeric).Width(90).Add();
})
.IsResponsive(true)
.ClientSideEvents(eve => {
eve.ActionBegin("actionBegin");
eve.RowSelecting("rowSelecting");
eve.EndEdit("endEdit");
})
)
Lev