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

DRAG & DROP bound to RIA Domain Data source not allowing drop

3 Answers 93 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Bryan Williams
Top achievements
Rank 2
Bryan Williams asked on 25 Mar 2010, 04:17 PM

 

 

 

I'm trying to do a simple drag and drop to allow re-ordering of my treeview nodes.
But this does not seem to be allowing the drop. In DragEnded, Status is cancel.
Any ideas what I'm doing wrong???


<
telerikNavigation:RadTreeView x:Name="MenuBarTreeView"

 

 

 

Margin="3,3,3,3" IsLineEnabled="False" SelectionMode="Single"

 

 

 

IsEditable="False" MinWidth="250"

 

 

 

IsDragDropEnabled="True" IsDragPreviewEnabled="True"

 

 

 

DragStarted="MenuBarTreeView_DragStarted"

 

 

 

DragEnded="MenuBarTreeView_DragEnded"

 

 

 

SelectedValuePath="menu_bar_id"

 

 

 

ItemsSource="{Binding Mode=OneWay,Path=Data,Source={StaticResource MenuBarDataSource}}" >

 

 

 

 

<telerikNavigation:RadTreeView.ItemTemplate>

 

 

 

 

<DataTemplate>

 

 

 

 

<StackPanel Orientation="Horizontal">

 

 

 

 

<TextBlock HorizontalAlignment="Left" Width="27" Text="{Binding menu_bar_id, Mode=OneWay}"

 

 

 

Foreground="{Binding inactive_date, Converter={StaticResource InactiveConverter}, Mode=OneWay}"

 

 

 

AllowDrop="True"/>

 

 

 

 

<TextBlock HorizontalAlignment="Left" Width="270" Text="{Binding client_menu_bar_name, Mode=OneWay}"

 

 

 

Foreground="{Binding inactive_date, Converter={StaticResource InactiveConverter}, Mode=OneWay}"/>

 

 

 

 

</StackPanel>

 

 

 

 

</DataTemplate>

 

 

 

 

</telerikNavigation:RadTreeView.ItemTemplate>

 

 

 

 

</telerikNavigation:RadTreeView>

 

3 Answers, 1 is accepted

Sort by
0
Accepted
Kiril Stanoev
Telerik team
answered on 29 Mar 2010, 02:57 PM
Hi Bryan,

Unfortunately I was not able to reproduce the issue. I am shooting in the dark, but one of the prerequisites reordering items in the TreeView to work is the TreeView to be bound to an ObservableCollection. I am attaching my sample project for further reference. Have a look at it and let me know if I am missing something. If this does not help, could you please provide us with a sample project reproducing the issue. This way we will be better able to assist you.

All the best,
Kiril Stanoev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Jill
Top achievements
Rank 1
answered on 27 Jan 2011, 11:35 PM
I know this is an old topic but I am having the same issue. It will start to drag but it gives me the "X" image that it can't drop. I do have my data returning from RIA in a ObservableCollection.

The documentation tells you two different ways of doing things and I have tried both ways. Am I missing something? My XAML declaration looks like this;
<telerik:RadTreeView x:Name="ActivityTreeView"
                                     Height="200"
                                     Background="White"
                                     IsDragDropEnabled="True"
                                     IsDragPreviewEnabled="True"
                                     SelectionMode="Single"
                                     telerik:RadDragAndDropManager.AllowDrop="True"
                                     ExpanderStyle="{StaticResource ExpanderStyle1}"
                                     ItemTemplate="{StaticResource Item}"
                                     ItemsSource="{Binding DataView, ElementName=ddsCommentActivities}"
                                     SelectionChanged="ActivityTreeView_SelectionChanged"
                                     PreviewDragEnded="ActivityTreeView_PreviewDragEnded"
                                     DragStarted="ActivityTreeView_DragStarted"
                                     DragEnded="ActivityTreeView_DragEnded" />

I have turned on the Drag Preview as you can see and I do not get the tooltip or the preview drop line and info showing up. I only get the x image. Please help!!!
0
Petar Mladenov
Telerik team
answered on 01 Feb 2011, 07:45 PM
Hello Chris,

We cannot see something unusual in this part of your XAML (the snippet is not full), but it is also very difficult to get in your scenario without your code behind. We would highly appreciate if you can send us a runnable sample, or at least a part of the project that we can use for a starting point. Only xaml is quite insufficient.
However, a possible reason that can prevent the dropping inside a particular item could be that his Items (Children, Inheritors) collection is not generated. Other possible scenario is that you try to drag an item of type X to into an item that has child collection of type Y, or onto a tree root-level of items of type Z . Please note that these are only suppositions. A view of your database,xaml and code behind would be highly appreciated. This way we could provide with a better advice much faster.

Best wishes,
Petar Mladenov
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
TreeView
Asked by
Bryan Williams
Top achievements
Rank 2
Answers by
Kiril Stanoev
Telerik team
Jill
Top achievements
Rank 1
Petar Mladenov
Telerik team
Share this question
or