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

Drag drop between two tree views not possible?

1 Answer 27 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Dieter Schmitz
Top achievements
Rank 1
Dieter Schmitz asked on 18 Dec 2009, 10:42 AM
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

1 Answer, 1 is accepted

Sort by
0
Miroslav
Telerik team
answered on 21 Dec 2009, 12:14 PM
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.
Tags
TreeView
Asked by
Dieter Schmitz
Top achievements
Rank 1
Answers by
Miroslav
Telerik team
Share this question
or