I'm trying to dislpay a text informing the user that more items are loaded on the background of the tree view. I am trying to change the template. As soon as the ItemsPresenter is not a direct child of ScrollViewer the tree stops displaying the items.
Here is my template:
<ControlTemplate x:Key="RadTreeViewWithLoadingTemplate" TargetType="{x:Type telerik:RadTreeView}">
<Grid x:Name="RootElement">
<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
<Grid>
<ScrollViewer x:Name="ScrollViewer" BorderThickness="0" Background="{x:Null}" CanContentScroll="True" HorizontalScrollBarVisibility="Auto" IsTabStop="False"
Padding="{TemplateBinding Padding}" VerticalScrollBarVisibility="Auto"
Style="{DynamicResource LoadingScrollViewerStyle}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<ItemsPresenter/>
<TextBlock Text="Loading more items!" Height="20" VerticalAlignment="Center" HorizontalAlignment="Center" Grid.Row="1"/>
</ScrollViewer>
</Grid>
</Border>
</Grid>
</ControlTemplate>
Thanks,
Justyna
Here is my template:
<ControlTemplate x:Key="RadTreeViewWithLoadingTemplate" TargetType="{x:Type telerik:RadTreeView}">
<Grid x:Name="RootElement">
<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
<Grid>
<ScrollViewer x:Name="ScrollViewer" BorderThickness="0" Background="{x:Null}" CanContentScroll="True" HorizontalScrollBarVisibility="Auto" IsTabStop="False"
Padding="{TemplateBinding Padding}" VerticalScrollBarVisibility="Auto"
Style="{DynamicResource LoadingScrollViewerStyle}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<ItemsPresenter/>
<TextBlock Text="Loading more items!" Height="20" VerticalAlignment="Center" HorizontalAlignment="Center" Grid.Row="1"/>
</ScrollViewer>
</Grid>
</Border>
</Grid>
</ControlTemplate>
Thanks,
Justyna