How to drag items from different component and drop it in treeview?

Hi,
I need to know can we drag a item from any component like listview, listbox or a grid and drop it to treeview at the sidebar and update the treeview data.

Regards,
Pooja K

3 Replies 1 reply marked as answer

IL Indhumathy Loganathan Syncfusion Team March 23, 2021 02:39 PM UTC

Hi Pooja, 
 
Greetings from Syncfusion support. 
 
We have validated your requirement in Syncfusion components. We understood that you want to drag and drop items from different components to TreeView. In TreeView, you can add an external node while dropping by using addNodes method. But currently we don’t have drag and drop support in ListView component. 
 
Also in ListBox component, “Drag and Drop from ListBox to other components” is considered as a feature and this will be included in Volume 1, SP 1 release which is expected to be rolled out by the month of May, 2021. You can track the status through below feedback link.    
  
 
In Grid, we are facing an script error while Drag and Drop from Grid to other controls. We have confirmed it as a bug and the fix will be included in our upcoming weekly patch release which is expected to be rolled out by the end of March, 2021. You can track the status through the below link. 
 
 
We would like to let you know that, in TreeView, we can drag and drop between TreeView or to other components (from TreeView). Please refer to the below demo sample for similar scenario. 
 
 
Check out the below links to know more about Angular TreeView component, 
 
 
 
 
Please let us know if you need any further assistance. 
 
Regards, 
Indhumathy L 



PK pooja kalegowda March 25, 2021 04:50 AM UTC

Hi,
Thank you for your reply, but I need more support on this.
I need to drag a label or any data from external and drop it to treeview on wherever I point the mouse and drop. How can I achieve this?
Please find below my requirement. I need to drag the items from right panel which is regular label or any external data and drop it in the tree.


 


IL Indhumathy Loganathan Syncfusion Team March 26, 2021 02:47 PM UTC

Hi Pooja, 
 
As mentioned earlier, you can add an external node inside TreeView by using the addNodes method in the drop event of corresponding external element. The script error issue in Grid component has been resolved and the fix has been included in our latest release.  
 
Please check the below feedback link. 
 
 
So, we suggest you to use the Grid as external component and perform drag and drop to TreeView as per your requirement. We have addressed similar requirement in the below forum and please refer this for more details.  
 
 
In the above forum, we have used Grid rowDrop event to add a node to TreeView.  
 
Please check the provided details and let us know if you need any further assistance. 
 
Regards, 
Indhumathy L 


Marked as answer
Loader.
Up arrow icon