This is a migrated thread and some comments may be shown as answers.

RadTreeView Virtualizing then TreeViewItem header disappear

6 Answers 173 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 15 Mar 2011, 03:54 AM
I'm not sure whether this is a bug or something I haven't done correctly. I have the following very simple codes in an XBap:

    <Telerik:RadTreeView IsVirtualizing="True">
      <Telerik:RadTreeViewItem Header="Parent Node">
        <Telerik:RadTreeViewItem Header="Child Node">
          <Telerik:RadTreeViewItem Header="Grandchild Node">
            <Telerik:RadTreeViewItem Header="No idea"></Telerik:RadTreeViewItem>
            </Telerik:RadTreeViewItem>
          </Telerik:RadTreeViewItem>
      </Telerik:RadTreeViewItem>
    </Telerik:RadTreeView>

Please do notice that I set IsVirtualizing to True. If I run it then expand, then collapse a TreeViewItem a few times, the child TreeViewItem header disappear.

My test application is an XBap with Visual Studio 2010 and .Net 4.

Edited: I know the title of the post sounds really weird. I tried to change but there seems to be no way to do that.
Much appreciate for all your help.

6 Answers, 1 is accepted

Sort by
0
Accepted
Tina Stancheva
Telerik team
answered on 17 Mar 2011, 06:13 PM
Hi Michael,

This is a known issue and it is logged in our PITS where you can track its progress.

Please accept our apology for the caused inconvenience.

Regards,
Tina Stancheva
the Telerik team
0
Michael
Top achievements
Rank 1
answered on 18 Mar 2011, 01:52 AM
Many thanks for your reply. I will use ListBox instead of the TreeView then cause the .Net TreeView also has bugs when turn on virtualization.

Apart from this bug, Telerik controls are great really. We r considering buying them for our project. Cheers
0
Brandon
Top achievements
Rank 1
answered on 30 Jul 2014, 10:05 PM
Exact bug is happening to me now - any ideas how to fix it?
0
Pavel R. Pavlov
Telerik team
answered on 31 Jul 2014, 05:35 AM
Hello Brandon,

Please note that the UIVirtualization of the RadTreeView control is designed to work in data binding scenarios. If you declare the control with its items in XAML you actually create UIContainers hence the UIVirtualization does not take place.

In other words the RadTreeView control does not support virtualization when using XAML items.

Regards,
Pavel R. Pavlov
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
0
Brandon
Top achievements
Rank 1
answered on 31 Jul 2014, 05:30 PM
This happens using data source. Unfortunately I can't attach a project for you. So here is my xaml:

<Window
        xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" x:Class="WpfApplication3.MainWindow"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
 
        <telerik:RadTreeView x:Name="m_tree" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsVirtualizing="True" LoadOnDemand="m_tree_LoadOnDemand">
        </telerik:RadTreeView>
 
    </Grid>
</Window>


And here is MainWindow.xaml.cs



public partial class MainWindow : Window
{
   public MainWindow()
   {
      InitializeComponent();
 
      string[] items = new string[]
      {
         "Hello",
         "There",
      };
 
      m_tree.ItemsSource = items.Select(s => new Telerik.Windows.Controls.RadTreeViewItem() { Header = s, IsLoadOnDemandEnabled = true });
   }
 
   private void m_tree_LoadOnDemand(object sender, Telerik.Windows.RadRoutedEventArgs e)
   {
      (e.OriginalSource as Telerik.Windows.Controls.RadTreeViewItem).Items.Add(new Telerik.Windows.Controls.RadTreeViewItem() { Header = "one" });
      (e.OriginalSource as Telerik.Windows.Controls.RadTreeViewItem).Items.Add(new Telerik.Windows.Controls.RadTreeViewItem() { Header = "two" });
      (e.OriginalSource as Telerik.Windows.Controls.RadTreeViewItem).IsLoadingOnDemand = false;
   }





0
Pavel R. Pavlov
Telerik team
answered on 04 Aug 2014, 01:20 PM
Hello Brandon,

I can see in the provided snippets that you actually create UI containers (e.g. RadTreeViewItem). This is the reason why the virtualization cannot take place in your particular scenario. You should create business items and let the control decide when the UI containers should be created.

You can find a sample demonstration how the LoadOnDemand feature can be used with virtualization in our documentation. Please give this approach a try and let us know if you need any further assistance. 

Regards,
Pavel R. Pavlov
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
TreeView
Asked by
Michael
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
Michael
Top achievements
Rank 1
Brandon
Top achievements
Rank 1
Pavel R. Pavlov
Telerik team
Share this question
or