I have a Treeveiw bound to an ObservableCollection TheClassifications :
<
telerik:RadTreeView
Grid.Column
=
"2"
SelectionMode
=
"Multiple"
IsLineEnabled
=
"True"
IsExpandOnDblClickEnabled
=
"True"
IsExpandOnSingleClickEnabled
=
"True"
IsSingleExpandPath
=
"False"
IsDragDropEnabled
=
"True"
IsRootLinesEnabled
=
"True"
Margin
=
"10"
x:Name
=
"RadTreeView1"
IsTriStateMode
=
"True"
ItemsSource
=
"{Binding TheClassifications, Mode=TwoWay}"
ItemTemplate
=
"{StaticResource myTelerikHierarchicalTemplate}"
/>
ObservableCollection<ClassificationItem> TheClassifications_;
public
ObservableCollection<ClassificationItem> TheClassifications
{
get
{
return
TheClassifications_; }
set
{ SetObjValue(TheClassifications_, value, x => TheClassifications_ = x, () => TheClassifications); }
}
I have 2 problems :
1- I can drop elements only on the root node
2- The droped elements are duplicated
I'll attach a screenshot to show you those problems...
How can I fix it ?
Thanks
Kacem
6 Answers, 1 is accepted
I'm using Ria Services SP1 and my collection is an EntityCollection, so I can't change it :(
Is there any issue ?
Edit :
This post may help others : http://www.telerik.com/community/forums/silverlight/treeview/can-not-drag-drop-the-radtreeview-nodes.aspx#1019981
When using Drag'n'Drop it's important that the ItemsSource colelction of the TreeView is ObservableCollections and the destination item's child collection is already initialized. When working with services that return IEnumerable, you can create a wrapper classes that use ObservableCollections. In this blog post you can check out how this could be achieved.
Regards,Petar Mladenov
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>
Is there any way to manage Add/Remove operations myself ?
With RadTreeView I can't drop any elements on my nodes, so the idea is to allow drop and manage the operations myself ...
Thanks
Kacem
The way to manage the CRUD operations on your own is to handle the RadDragAndDropManager's events in the RadTreeView. You can find more info on how to work with these events in this documentation article.
Please let us know if you need more info on this.
Petar Mladenov
the Telerik team
Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>