Hi,
I'm working with a two-level treeview and am able to drag elements from the first level without any complications. When I drag from the second level, however, the dragged item displays using the template for the first level.
These are the two templates being used:
And this is the treeview definition:
I assume this is not an inherent problem in the control, but don't see what in these declarations would cause the issue. The version of the control being used is 2009.3.1208.1030
Any light that could be shed on this would be greatly appreciated.
Thanks,
Geoff
I'm working with a two-level treeview and am able to drag elements from the first level without any complications. When I drag from the second level, however, the dragged item displays using the template for the first level.
These are the two templates being used:
<core:HierarchicalDataTemplate x:Key="SectionsTemplate"> |
<Border BorderThickness="1,0,1,0" CornerRadius="4" BorderBrush="Red" |
Background="{Binding Index, Converter={StaticResource AlternateBrush}}" |
MouseEnter="SectTemplate_MouseEnter" |
MouseLeave="SectTemplate_MouseLeave" |
> |
<Grid Margin="2" Loaded="SectionsTemplate_Loaded"> |
<Grid.ColumnDefinitions> |
<ColumnDefinition Width="5" /> |
<ColumnDefinition Width="50" /> |
<ColumnDefinition Width="90" /> |
<ColumnDefinition Width="108" /> |
<ColumnDefinition Width="5" /> |
</Grid.ColumnDefinitions> |
<Grid.RowDefinitions> |
<RowDefinition /> |
<RowDefinition Height="2" /> |
<RowDefinition /> |
</Grid.RowDefinitions> |
<!--1st Column--> |
<TextBlock Grid.Column="1" Grid.Row="0" |
Text="{Binding SectionNumber}" /> |
<TextBlock Grid.Column="1" Grid.Row="2" |
Text="{Binding Days}" /> |
<!--2nd Column--> |
<TextBlock Grid.Column="2" Grid.Row="0" |
Text="{Binding CallNumber}" /> |
<TextBlock Grid.Column="2" Grid.Row="2" |
Text="{Binding TimeSlot}" /> |
<!--3rd Column--> |
<TextBlock Grid.Column="3" Grid.Row="0" |
Text="{Binding Instructor}" /> |
<TextBlock Grid.Column="3" Grid.Row="2" |
Text="{Binding Location}" /> |
</Grid> |
</Border> |
</core:HierarchicalDataTemplate> |
<core:HierarchicalDataTemplate x:Key="CoursesTemplate" |
ItemsSource="{Binding Sections}" |
ItemTemplate="{StaticResource SectionsTemplate}" |
> |
<Border CornerRadius="5" BorderBrush="Maroon" BorderThickness="1" |
MouseEnter="CourseTemplate_MouseEnter" |
MouseLeave="CourseTemplate_MouseLeave" |
> |
<Border.Background> |
<LinearGradientBrush EndPoint="0.5,1" |
StartPoint="0.5,-0.142"> |
<GradientStop Color="#7F420000" |
Offset="0.92" /> |
<GradientStop Color="White" |
Offset="0.007" /> |
<GradientStop Color="#FF943D3D" |
Offset="0.374" /> |
<GradientStop Color="#FEB58787" |
Offset="0.678" /> |
<GradientStop Color="#FF630000" /> |
</LinearGradientBrush> |
</Border.Background> |
<Grid Margin="2" Loaded="CoursesTemplate_Loaded"> |
<Grid.Background> |
<LinearGradientBrush EndPoint="0.5,1" |
StartPoint="0.5,0"> |
<GradientStop Color="#FF922222" |
Offset="1" /> |
<GradientStop Color="#FFF1DDDD" /> |
<GradientStop Color="#FFB54242" |
Offset="0.478" /> |
<GradientStop Color="#FBB58787" |
Offset="0.418" /> |
</LinearGradientBrush> |
</Grid.Background> |
<Grid.ColumnDefinitions> |
<ColumnDefinition Width="4" /> |
<ColumnDefinition Width="70" /> |
<ColumnDefinition Width="30" /> |
<ColumnDefinition Width="180" /> |
</Grid.ColumnDefinitions> |
<StackPanel Grid.Column="1" Orientation="Horizontal"> |
<TextBlock Foreground="White" Text="{Binding DiscCode}" /> |
<TextBlock Foreground="White" Text="{Binding Number}" /> |
</StackPanel> |
<TextBlock Foreground="White" Grid.Column="2" Text="{Binding Credits}" /> |
<TextBlock Foreground="White" Grid.Column="3" Text="{Binding Name}" /> |
</Grid> |
</Border> |
</core:HierarchicalDataTemplate> |
And this is the treeview definition:
<nav:RadTreeView x:Name="CoursesTree" |
Grid.Row="4" |
Grid.ColumnSpan="2" |
IsTriStateMode="True" |
ItemsOptionListType="CheckList" |
IsOptionElementsEnabled="True" |
SelectionMode="Extended" |
ItemsSource="{Binding Courses}" |
ItemTemplate="{StaticResource CoursesTemplate}" |
HorizontalAlignment="Left" |
Checked="CoursesTree_Checked" |
Unchecked="CoursesTree_Checked" |
ItemPrepared="CoursesTree_ItemPrepared" |
IsDragDropEnabled="True" |
/> |
I assume this is not an inherent problem in the control, but don't see what in these declarations would cause the issue. The version of the control being used is 2009.3.1208.1030
Any light that could be shed on this would be greatly appreciated.
Thanks,
Geoff