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

[Solved] Drag & drop issue with Mulitple Hierachical Data Template

3 Answers 49 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jingying Wu
Top achievements
Rank 1
Jingying Wu asked on 23 Jul 2009, 06:42 PM
we have 2 Hierachical Data Template, and have dynamic data binding using these Hierachical Data Template.
 Ie. The list of items for the tree view comes from the database
We can see the tree view, and can drag,
But we can't drop the dragged item.

We tried static items for the tree view defined in the xaml, like your example and it works all fine.
But we can only use dynamic list coming from the database.

Please help.




3 Answers, 1 is accepted

Sort by
0
Miroslav
Telerik team
answered on 24 Jul 2009, 08:07 AM
Hi Jingying Wu,

It seems that the collections that you bind to are not observable. Can you confirm that the ItemsSource of the TreeView (and consecutively of the TreeViewItems) is an ObservableCollection or implements the INotifyCollectionChnged. Also, can you confirm that the collections are not ReadOnly?

If so, then could you turn on all exceptions and see if any are throw?

Any more details concerning the items source will be helpful.

Kind regards,
Miroslav
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Jingying Wu
Top achievements
Rank 1
answered on 24 Jul 2009, 06:49 PM
Hi Miroslav,

We tried the observable collection to no avail.
I have attached a sample to a support ticket (Your ticket ID is : 230101 )

Can you help us with this?
Thanks
0
Miroslav
Telerik team
answered on 27 Jul 2009, 07:39 AM
Hi Jingying Wu,

Thank you for sending the sample project, it really helps get to the problem quickly.

I had a look at the project and I noticed that you are using observable collection for thee TreeView's items source but Lists for the ItemsSource of the children. This way there will be no notification for the TreeView when dropping into these collections. Then I noticed that the children's collections are of type string. This means that no Level items will be successfully dropped there. Converting the collection generic type to object helped this.

I ma sending the changed project. Come do back to us if you need more help.

Sincerely yours,
Miroslav
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
TreeView
Asked by
Jingying Wu
Top achievements
Rank 1
Answers by
Miroslav
Telerik team
Jingying Wu
Top achievements
Rank 1
Share this question
or