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

Radsplitbutton with large number of objects in dropdowncontent slow to open

1 Answer 60 Views
Buttons
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Laura Edwards
Top achievements
Rank 1
Laura Edwards asked on 01 Apr 2011, 02:49 PM
Hi,

I am using a radsplitbutton to display a large number of objects in the dropdown in an itemscontrol. The itemscontrol has virtualization on it. When I click the button to open the dropdown it is extremely slow to open. Is there a way to speed up the opening of the dropdown with a large number of objects or must I wait even with virtualization on the itemscontrol?

1 Answer, 1 is accepted

Sort by
0
Tina Stancheva
Telerik team
answered on 06 Apr 2011, 03:46 PM
Hello Laura Edwards,

Basically when an ItemsControl is virtualized, it only realizes those items that are in its viewport. So if you limit the size of the veiwport, the number of realized items will be limited.

You can set the DropDownHeight property to a relatively small height so that your virtualized ItemsControl will only realize the items that can be displayed inside this DropDownHeight. This way you will limit the time it takes for the items to realized thus speeding up the opening of the DropDownContent. For example:
<telerik:RadSplitButton HorizontalAlignment="Center"
                        VerticalAlignment="Center"
                        Content="{Binding Content}"
                        DropDownContent="{Binding Items}"
                        DropDownHeight="100">
    <telerik:RadSplitButton.DropDownContentTemplate>
        <DataTemplate>
            <telerik:RadTreeView x:Name="myTreeView" Loaded="myTreeView_Loaded"
                                    ItemsSource="{Binding}"
                                    IsVirtualizing="True">
                <telerik:RadTreeView.ItemTemplate>
                    <telerik:HierarchicalDataTemplate ItemsSource="{Binding Children}">
                        <TextBlock Text="{Binding Header}" />
                    </telerik:HierarchicalDataTemplate>
                </telerik:RadTreeView.ItemTemplate>
            </telerik:RadTreeView>
        </DataTemplate>
    </telerik:RadSplitButton.DropDownContentTemplate>
</telerik:RadSplitButton>

Give this a try and let us know if it works for you.

All the best,
Tina Stancheva
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Buttons
Asked by
Laura Edwards
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
Share this question
or