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

Virtualization with the Q3 Silverlight Treeview

2 Answers 61 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Yoann
Top achievements
Rank 1
Yoann asked on 04 Nov 2009, 04:13 PM
Hi All,

I have just downloaded the new Q3 release for the silverlight controls, because I was waiting for the new virtualization capabilities of the treeview.
I have just tried it, and it seems that there are some problems, but maybe it is issues from my side.
First of all, here is my code...
The tree view declaration :
<telerikNavigation:RadTreeView
            x:Name="Tree"
            ItemTemplate="{StaticResource TreeDataTemplate}" 
ItemsSource="{Binding Path=Items}"
            SelectedValuePath="{Binding Path=SelectedValuePath, Mode=TwoWay}"
            SelectionMode="Single"
            IsEditable="False"
            SelectionChanged="Tree_SelectionChanged"
            IsVirtualizing="True"
            Grid.Row="4" />

The associated data template :
        <core:HierarchicalDataTemplate x:Key="TreeDataTemplate"
            ItemsSource="{Binding Children}"
            core:ContainerBinding.ContainerBindings="{StaticResource ItemsCollection}">
            <StackPanel Orientation="Horizontal" >
                <Image Source="{Binding Picto}" />
                <TextBlock Text="{Binding Label}" Margin="5,0" />
            </StackPanel>
        </core:HierarchicalDataTemplate>

and finally the data binding collection :
        <core:ContainerBindingCollection x:Name="ItemsCollection">
            <core:ContainerBinding PropertyName="IsSelected" Binding="{Binding IsSelected, Mode=TwoWay}" />
            <core:ContainerBinding PropertyName="IsExpanded" Binding="{Binding IsExpanded, Mode=TwoWay}" />
            <core:ContainerBinding PropertyName="Visibility" Binding="{Binding Visibility}" />
            <core:ContainerBinding PropertyName="HasItems" Binding="{Binding HasItems}" />
        </core:ContainerBindingCollection>

I am playing with the Visibility property of my binded objects to show or hide some nodes. The problem is that the right schroll bar of the treeview doesn't update with the visible items count. It takes the total items count. It means that I can have a scroll bar that lets the user think that there are a lot of items in my view, but in fact, only a few are visible (see attached screenshot)...

Is there a way to avoid that ?

Cheers,

Yoann

2 Answers, 1 is accepted

Sort by
0
Yoann
Top achievements
Rank 1
answered on 04 Nov 2009, 04:17 PM
Note : I just tried without virtualization, and the scrollbar behaviour is the same.
0
Miroslav
Telerik team
answered on 09 Nov 2009, 06:41 PM
Hi Yoann,

Unfortunately collapsing a TreeView item may lead to unexpected behavior from the TreeView. For example keyboard navigation and methods like GetItemByPath may not work correctly (even when the user tries to navigate).

The virtualizing panel keeps the item sizes in a separate register and collapsing an item is currently not taken into account.

May you describe your scenario, so that we could suggest an alternative approach.

I have added this problem in the product backlog as a bug.

Your Telerik Points have been updated for your feedback.

Kind regards,
Miroslav
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
TreeView
Asked by
Yoann
Top achievements
Rank 1
Answers by
Yoann
Top achievements
Rank 1
Miroslav
Telerik team
Share this question
or