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

TreeView removes item on drop to listbox

3 Answers 37 Views
DragAndDrop
This is a migrated thread and some comments may be shown as answers.
Brian
Top achievements
Rank 1
Brian asked on 14 Feb 2011, 06:35 PM
Is there a way to keep the item in the treeView when you drag it to the listBox?


3 Answers, 1 is accepted

Sort by
0
Tsvyatko
Telerik team
answered on 15 Feb 2011, 10:20 AM
Hello Brian,

You might want to check PreviewDragEnded event. If it is handled, the treeview will not remove items from its collection.

Let me know if you have any other questions.

Greetings,
Tsvyatko
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
Brian
Top achievements
Rank 1
answered on 15 Feb 2011, 05:43 PM
ok i subscribed to the event, but i am unsure of what i would need to do in the event.  You have an example?
private void inputTree_PreviewDragEnded(object sender, RadTreeViewDragEndedEventArgs e)
        {
  
        }
0
Tsvyatko
Telerik team
answered on 16 Feb 2011, 08:03 AM
Hi Brian,

In order to make this work you need to add the following code:
private void inputTree_PreviewDragEnded(object sender, RadTreeViewDragEndedEventArgs e)
        {
             e.Handled=true;
        }

That way when drag ends the tree will not remove the dragged items.
Let me know if you need any further assistance.

Regards,
Tsvyatko
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
Tags
DragAndDrop
Asked by
Brian
Top achievements
Rank 1
Answers by
Tsvyatko
Telerik team
Brian
Top achievements
Rank 1
Share this question
or