Drag drop between two tree views not possible?

2 posts, 0 answers
  1. Dieter Schmitz
    Dieter Schmitz avatar
    6 posts
    Member since:
    Dec 2009

    Posted 18 Dec 2009 Link to this post

    Hi,

    I'm new in using your nice controls. Great job guys!

    Now to my problem:
    My application needs the functionality to drag & drop tree nodes between two treeviews which are placed in separate grid columns.
    Drag and Drop does not work. If I try to drag an item, the mouse cursor does not change and I have no idea why.

    The definition of the first treeview is:
    <telerik:RadTreeView IsOptionElementsEnabled="True"
                                       ItemsOptionListType="CheckList"
                                       IsLineEnabled="True"
                                       IsTriStateMode="True"
                                       LoadOnDemand="oTreeViewSource_LoadOnDemand"
                                       ItemPrepared="oTreeViewSource_ItemPrepared"
                                       IsDragDropEnabled="True"
                                       IsDragTooltipEnabled="False"
                                       AllowDrop="True"
                                       Margin="6"
                                       SelectionMode="Multiple"
                                       Name="oTreeViewSource" />

    and the definition of the second is:
    <telerik:RadTreeView IsDragDropEnabled="True"
                                       AllowDrop="True"
                                       Name="oTreeViewTarget"
                                       Margin="6"></telerik:RadTreeView>

    The items in the first treeview were added like this:
                RadTreeViewItem oTreeViewTargetItem = new RadTreeViewItem();
                oTreeViewTargetItem.Header = "New item";
                nIndex = oTreeViewSource.Items.Add(oTreeViewTargetItem);

    Does anyone has an idea what is wrong?

    Thanks
    Dieter
  2. Miroslav
    Admin
    Miroslav avatar
    922 posts

    Posted 21 Dec 2009 Link to this post

    Hi Dieter Schmitz,

    I created a simple project with the 2009.3.1208 version following your code and it seems to work for me.

    Is it possible that you have not set the Grid.Column proeprty in your case? Then the TreeViews will overlap and drop will not be possible. Please see the attached project if necessary.

    Kind regards,
    Miroslav
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top