Download on demand with telerik radar

I am creating a Radtreeview with children using the load on demand event to load children and it works fine.

The problem is that for each child there is an extension sign, but there is a point at which there are no parent elements, in this case for the children I do not want to show the extension sign. How can i achieve this?

+6
source share
1 answer

I found the answer that there is a property IsLoadOnDemandEnabled and sets this property to false in the ItemPrepared event.

<telerik:RadTreeView x:Name="radTreeView" IsExpandOnSingleClickEnabled="True" IsLoadOnDemandEnabled="true" LoadOnDemand="RadTreeView_LoadOnDemand" ItemPrepared="radTreeView_ItemPrepared" ItemsSource="{Binding TreeViewSource,Mode=OneWay}" ItemTemplate="{StaticResource ParentTemplate}" /> 

and in xaml.cs

  private void radTreeView_ItemPrepared(object sender, RadTreeViewItemPreparedEventArgs e) { // get a reference to the item that has been selected RadTreeViewItem preparedItem = e.PreparedItem as RadTreeViewItem; preparedItem.IsLoadOnDemandEnabled = false; } 

for reference http://www.telerik.com/help/wpf/radtreeview-features-load-on-demand.html

+6
source

Source: https://habr.com/ru/post/926472/


All Articles