I'm using a RadTreeView with multiple levels of HierarchicalDataTemplates, when I try and drag an item from a lower level it always uses the DataTemplate for the top level. Only way I can see to fix it right now is to implement the TreeView drag drop myself, which I'd rather avoid.
I quickly modified a sample found at http://www.telerik.com/ClientsFiles/163825_testtreeview1.zip
The tree looks correct but when I drag a child I don't see the 'blah' that prepended it in the tree because it is using the root template.
I've tried hooking the DragQuery and setting the e.Options.DragCue but that did not seem to change anything.
I quickly modified a sample found at http://www.telerik.com/ClientsFiles/163825_testtreeview1.zip
The tree looks correct but when I drag a child I don't see the 'blah' that prepended it in the tree because it is using the root template.
I've tried hooking the DragQuery and setting the e.Options.DragCue but that did not seem to change anything.
<UserControl x:Class="TestTreeView1.MainPage" |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
xmlns:telerikNavigation="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation" |
xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls" |
mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480"> |
<UserControl.Resources> |
<telerik:HierarchicalDataTemplate x:Key="childTemplate" |
ItemsSource="{Binding SearchDef.SearchItems, Mode=OneWay}" |
> |
<StackPanel Orientation="Horizontal"> |
<TextBlock Text="blah" /> |
<TextBlock Text="{Binding Name}" FontWeight="Bold" FontSize="12" /> |
</StackPanel> |
</telerik:HierarchicalDataTemplate> |
</UserControl.Resources> |
<Grid x:Name="LayoutRoot"> |
<telerikNavigation:RadTreeView x:Name="RadTreeView1" |
Margin="10" |
IsLineEnabled="True" SelectionMode="Single" IsEditable="True" |
IsDragDropEnabled="True" |
PreviewDragStarted="RadTreeView1_PreviewDragStarted" |
IsDragTooltipEnabled="True" |
ItemsSource="{Binding SearchDef.SearchItems, Mode=OneWay}" |
> |
<telerikNavigation:RadTreeView.ItemTemplate> |
<telerik:HierarchicalDataTemplate ItemsSource="{Binding SearchDef.SearchItems, Mode=OneWay}" |
ItemTemplate="{StaticResource childTemplate}"> |
<StackPanel Orientation="Horizontal"> |
<TextBlock Text="{Binding Name}" FontWeight="Bold" FontSize="12" /> |
</StackPanel> |
</telerik:HierarchicalDataTemplate> |
</telerikNavigation:RadTreeView.ItemTemplate> |
</telerikNavigation:RadTreeView> |
</Grid> |
</UserControl> |