Hi
I've been following this example for binding to object data.
However I can't specify the <DataTemplate>.
Instead I get the message "Property 'VisualTree' does not support values of type 'DataTemplate'".
What am I doing wrong?
I've been following this example for binding to object data.
However I can't specify the <DataTemplate>.
Instead I get the message "Property 'VisualTree' does not support values of type 'DataTemplate'".
What am I doing wrong?
| <UserControl x:Class="ReportDistribution.Client.ReportMgr.WpfApp.UserControls.ReportMenuPanel" |
| xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
| xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation" |
| Height="300" Width="270"> |
| <UserControl.Resources> |
| <ItemsControl> |
| <ItemsControl.ItemTemplate> |
| <HierarchicalDataTemplate x:Key="Entity" ItemsSource="{Binding ClientReport}"> |
| <DataTemplate> |
| <TextBlock Text="{Binding Name}"></TextBlock> |
| </DataTemplate> |
| </HierarchicalDataTemplate> |
| </ItemsControl.ItemTemplate> |
| </ItemsControl> |
| </UserControl.Resources> |
| <Grid> |
| <Grid.RowDefinitions> |
| <RowDefinition Height="35"></RowDefinition> |
| <RowDefinition></RowDefinition> |
| </Grid.RowDefinitions> |
| <Grid.ColumnDefinitions> |
| <ColumnDefinition></ColumnDefinition> |
| </Grid.ColumnDefinitions> |
| <Border Grid.Row="0" BorderBrush="Black" BorderThickness="1"> |
| <Border.Background> |
| <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1"> |
| <GradientStop Color="#ADCFFF" /> |
| <GradientStop Color="#599BFF" Offset="1"></GradientStop> |
| </LinearGradientBrush> |
| </Border.Background> |
| </Border> |
| <TextBlock Grid.Row="0" VerticalAlignment="Center" FontSize="14" FontWeight="Bold" Margin="5">Reports</TextBlock> |
| <Border Grid.Row="1" BorderBrush="Black" BorderThickness="1,0,1,1"> |
| <Border.Background> |
| <SolidColorBrush Color="White" /> |
| </Border.Background> |
| </Border> |
| <telerik:RadPanelBar x:Name="reportMenuPanelBar" Grid.Row="1" Margin="1,0,1,1" ItemTemplate="{StaticResource Entity}" ItemsSource="{Binding}"> |
| </telerik:RadPanelBar> |
| </Grid> |
| </UserControl> |