We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

TreeGrid: values in new record

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-record
But 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

1 Reply

JS Jonesherine Stephen Syncfusion Team August 11, 2016 07:22 AM UTC

Hi Lev, 
At present there is no support to trigger the actionBegin client side event while adding new row. For this we have already logged a feature request regarding this. 
A support incident has been created under your account to track the status of this requirement. Please log on to our support website to check for further updates. 
Please let us know if you require further assistance on this.
Regards,             
 
Jone sherine P S   


Loader.
Up arrow icon