This is a migrated thread and some comments may be shown as answers.

Insert a new item by positioning by row index, client-side

1 Answer 88 Views
TreeList
This is a migrated thread and some comments may be shown as answers.
Paul
Top achievements
Rank 1
Paul asked on 26 Apr 2017, 02:07 PM
I am looking to programmatically insert a new item in the TreeList client-side (javascript). I basically want to create a new item, set the new cell values,  its parent, and insert it into the tree at a predetermined position.  I found how to do this with the TreeView, but not the TreeList.

1 Answer, 1 is accepted

Sort by
0
Accepted
Eyup
Telerik team
answered on 01 May 2017, 12:51 PM
Hello Paul,

This can happen only on server-side. Generally, RadTreeList provides the following methods to open a new item in insert mode:
- InsertItem
- InsertChildItem

If you want this record to be automatically inserted without prompting the user to press the Insert button, you need to update the database directly and Rebind() the treelist afterwards. This can happen using the fireCommand method with a custom command, which you can then handle using the ItemCommand server-side event handler:
http://docs.telerik.com/devtools/aspnet-ajax/controls/grid/client-side-programming/gridtableview-object/methods/firecommand

I hope this will prove helpful.

Regards,
Eyup
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
TreeList
Asked by
Paul
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or