Help using treeview

I've put 2 treeview in 2 tab of a dockingmanager (WITHOUT USING MVVM). I want to bind them to 2 collections e.g.: the first to a list of websites, and the second to the Favorites Websites.

It's possible for the user grab one site from one treeview and move it the other (for example grab a site from 1 treeview and drop it in 2) updating the 2 collections?

If yes, can you provide an example without using MVVM, but using classic wpf, please?


3 Replies

VS Vijayarasan Sivanandham Syncfusion Team November 8, 2021 04:37 PM UTC

Hi Matteo,

Greetings from Syncfusion.

We have checked your query and we suspect that you want to use two treeview in two tab of a dockingmanager and drag drop between treeview. We have marked TreeViewAdv control as a classic control at our side. For this requirement we suggest you to use SfTreeView control instead of using TreeViewAdv control. In this SfTreeView control contains rich set of features compared to TreeViewAdv control.

For more information related to SfTreeView, please refer the below user guide documentation link,
Based on provided information we have prepared the sample for achieve your requirement.

Sample Link: https://www.syncfusion.com/downloads/support/forum/170214/ze/SfTreeViewDemo-1922324931

For more information related to Drag and drop, please refer the below user guide documentation link,

UG Link: https://help.syncfusion.com/wpf/treeview/drag-and-drop

https://help.syncfusion.com/wpf/treeview/drag-and-drop#drag-and-drop-between-two-treeviews

Please let us know if you have any concerns in this.

Regards,
Vijayarasan S



MA Matteo November 16, 2021 01:59 PM UTC

Thanks, What If the data is on another ViewModel? I tryed but I was not able to make it work. My data is stored in another model.



VS Vijayarasan Sivanandham Syncfusion Team November 17, 2021 01:29 PM UTC

Hi Matteo,

Thanks for the update.

Based on provided information we suspect that your application contains different models for different SfTreeView. We would like to inform you that the drag and drop operation between two SfTreeView will work only when the type of the underlying record for both the TreeView is same.  

Please revert to us with more details if we have misunderstood your scenario. 

Regards, 
Vijayarasan S

Loader.
Up arrow icon