TreeView removes item on drop to listbox

4 posts, 0 answers
  1. Brian
    Brian avatar
    20 posts
    Member since:
    Jan 2011

    Posted 14 Feb 2011 Link to this post

    Is there a way to keep the item in the treeView when you drag it to the listBox?


  2. Tsvyatko
    Admin
    Tsvyatko avatar
    832 posts

    Posted 15 Feb 2011 Link to this post

    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>>
  3. UI for WPF is Visual Studio 2017 Ready
  4. Brian
    Brian avatar
    20 posts
    Member since:
    Jan 2011

    Posted 15 Feb 2011 Link to this post

    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)
            {
      
            }
  5. Tsvyatko
    Admin
    Tsvyatko avatar
    832 posts

    Posted 16 Feb 2011 Link to this post

    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>>
Back to Top