TreeView and Grid Integration

2 Answers 47 Views
Grid TreeView
Aaqib
Top achievements
Rank 1
Aaqib asked on 26 Sep 2023, 02:16 PM
I want to integrate the Kendo UI TreeView component and Grid together such that the data in the Grid changes when interacting with the TreeView tabs.

2 Answers, 1 is accepted

Sort by
0
Neli
Telerik team
answered on 29 Sep 2023, 12:37 PM

Hi Aaqib,

I will need some additional time to review the provided requirements. I will get back to you with more information on the matter in the beginning of the next week. Thank you very much for your patience.

Regards,
Neli
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Kendo family, check out our getting started resources
0
Neli
Telerik team
answered on 04 Oct 2023, 05:42 AM

Hello Aaqib,

Thank you for your patience.

Linked below you will find a runnable example where the value in the TreeView can be changed based on the selection in the Grid. In the example, select a Node in the TreeView and a row in the Grid and then click the 'Set value' button. The text of the selected node in the TreeView will be changed.

https://dojo.telerik.com/@NeliKondova/IdOCARot

Below is the resepctive code:

$('#btn').kendoButton({
          themeColor: 'success',
          click: function(e){
            //grid
            var grid = $("#grid").data('kendoGrid')
            var gridSelected = grid.select()
            var gridDataItem = grid.dataItem(gridSelected);
            //treeview
            var treeView = $("#treeview").data('kendoTreeView')
            var treeViewSelected = treeView.select()
            var tvDataItem = treeView.dataItem(treeViewSelected);
            if(tvDataItem && gridDataItem){
                 tvDataItem.set('FullName', gridDataItem.ProductName )
            }else{
                 alert('please select an item in the TreeView and in the Grid')
            }
          }
 })

I hope you will find the example helpful. Let me know in case you have additional questions on the matter.

Regards,
Neli
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Kendo family, check out our getting started resources
Tags
Grid TreeView
Asked by
Aaqib
Top achievements
Rank 1
Answers by
Neli
Telerik team
Share this question
or