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

Combobox Performance with many Elements

15 Answers 730 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Nils
Top achievements
Rank 1
Nils asked on 11 Nov 2009, 08:53 AM
Hi.
I have created a RadComboBox containing some 10.000 elements.
This ComboBox is horrobly slow...
What can I do ?
My own Ideas vary from
 a) Go, get your head checked, 1000 elements are the maximum if you don't want your users to die of old age in front of the screen
to
 b) use the MagicallyAutoPaging="True" Property on the Combobox

Yours,
Nils

15 Answers, 1 is accepted

Sort by
0
Valeri Hristov
Telerik team
answered on 11 Nov 2009, 09:08 AM
Hello Nils,

I suppose that you didn't hardcode 10k RadComboBoxItem controls in XAML, so the following blog post should be of help:
http://blogs.telerik.com/valerihristov/posts/09-10-28/virtualized_telerik_combobox_for_silverlight.aspx

Regards,
Valeri Hristov
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.
0
Nils
Top achievements
Rank 1
answered on 11 Nov 2009, 10:51 AM
Valeri,
thanks for answering. It does not "feel" that much different.
Is there anything else I need to do ?
Code currently looks like this:
            <telerik:RadComboBox Margin="6" 
                                 Name="cbSelection" 
                                 ItemsSource="{Binding Path=ItemsSource, Mode=OneWay}" 
                                 SelectedItem="{Binding Path=SelectedItem, Mode=TwoWay}"
                <telerik:RadComboBox.ItemsPanel> 
                    <ItemsPanelTemplate> 
                        <VirtualizingStackPanel /> 
                    </ItemsPanelTemplate> 
                </telerik:RadComboBox.ItemsPanel> 
                <telerik:RadComboBox.ItemTemplate> 
                    <DataTemplate> 
                        <StackPanel Orientation="Horizontal"
                            <TextBlock Margin="1,1,1,2" 
                                       Text="{Binding Path=Bezeichnung, Mode=OneWay}" /> 
                            <TextBlock Margin="2,1,1,2" 
                                       Name="tbSeparator1" 
                                       Text="-" /> 
                            <TextBlock Margin="2,1,1,0" 
                                       Text="{Binding Path=Straße, Mode=OneWay}" /> 
                        </StackPanel> 
                        <DataTemplate.Triggers> 
                            <DataTrigger Binding="{Binding Path=Straße}"
                                         Value="{x:Null}"
                                <Setter TargetName="tbSeparator1" 
                                        Property="Text" 
                                        Value="" /> 
                            </DataTrigger> 
                            <DataTrigger Binding="{Binding Path=Straße}" 
                                         Value=""
                                <Setter TargetName="tbSeparator1" 
                                        Property="Text" 
                                        Value="" /> 
                            </DataTrigger> 
                        </DataTemplate.Triggers> 
                    </DataTemplate> 
                </telerik:RadComboBox.ItemTemplate> 
            </telerik:RadComboBox> 
 

Also, I'm using wpf while you'd blogged on Silverlight, Don't know if is make a difference in this case..



0
Valeri Hristov
Telerik team
answered on 13 Nov 2009, 03:14 PM
Hello Nils,

It seems that there is a problem in the WPF version of RadComboBox. I will need some time to research what's wrong and find a fix. I keep this thread open and I will write back again when I have more information to share.

I apologize for the inconvenience, your points have been updated!

Best wishes,
Valeri Hristov
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.
0
Dean
Top achievements
Rank 1
answered on 03 Dec 2009, 11:04 PM
I'm having the same issue here.  I have an instance where people want to use the combobox more like an auto-complete so I have 8,000 items in it, and performance is horrible.  Any update on this?

Cheers,

-Dean
0
Valeri Hristov
Telerik team
answered on 04 Dec 2009, 09:43 AM
Hello guys,

The control template of the RadComboBox for WPF is missing a property on the ScrollViewer, that enables the virtualization. We will provide a fix in the today's internal build, which will be also included in the service pack next week.

I apologize for the inconvenience.

Kind regards,
Valeri Hristov
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.
0
Dean
Top achievements
Rank 1
answered on 04 Dec 2009, 07:30 PM
Thanks.  In the meantime I got around this by creating a DataView that prunes elements and makes users start entering text to get elements in to the combobox:

private void someComboBox_KeyUp(object sender, KeyEventArgs e) 
        { 
            // Check type. 
            if (sender.GetType() == typeof(RadComboBox)) 
            { 
                // Cast combobox. 
                RadComboBox myComboBox = (RadComboBox)sender; 
                // Check length (depending on how many rows you have you might want to change this). 
                if (myComboBox.Text.Length > 1) 
                { 
                    // Get a DataView with items that start with string entered... this is assuming you have your data in a DataTable called myDataTable sitting in memory. 
                    myDataTable.DefaultView.RowFilter = string.Format("MyColumn LIKE '{0}*'", myComboBox.Text); 
                    myComboBox.DataContext = myDataTable.DefaultView.ToTable(); 
                } 
            } 
        } 

Pretty simple implementation and you could easily customize it for your own uses.  This might not be good for all users hitting this performance issue, but for times where it's acceptable to do this it should work.

Cheers,

-Dean
0
Balaji Shanmugasundaram
Top achievements
Rank 1
answered on 17 Dec 2009, 06:34 AM
We are also experiencing the same problem. Using RadComboBox and VirtualizingStackPanel. As soon we type in the Key, the selector is not moving to item which we have typed in letter starting item.  Selector moves to matching item when we dont use the VirtualizingStackPanel. But we are binding around 2K to 5K records to  RadComboBox, so no option living without the VirtualizingStackPanel. 
0
Valeri Hristov
Telerik team
answered on 22 Dec 2009, 03:01 PM
Hi everyone,

We had some problems with the keyboard navigation when the combo is virtualized, but we already fixed them and the next internal build of RadComboBox will contain proper virtualization support. I apologize for the caused inconveniences.

Regards,
Valeri Hristov
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.
0
Nils
Top achievements
Rank 1
answered on 04 Jan 2010, 09:25 AM
Valeri,
can you guess when this will be available in an official release (Q3 2009 SP2 / Q1 2010) ?

Nils
0
Accepted
Valeri Hristov
Telerik team
answered on 04 Jan 2010, 11:37 AM
Hi Nils,

Next week we will release an official service pack, that will contain the fixes with the virtualization.

All the best,
Valeri Hristov
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.
0
Dean
Top achievements
Rank 1
answered on 24 Mar 2010, 12:42 AM
I'm running the Q1 2010 build now and performance is still funky on this control.  I tried searching for a property to enable virtualization and couldn't find anything.  What am I missing?
0
Valeri Hristov
Telerik team
answered on 24 Mar 2010, 08:49 AM
Hi Dean,

Here is how to enable the virtualization on RadComboBox:
http://www.telerik.com/help/wpf/radcombobox-howto-virtualization.html

All the best,
Valeri Hristov
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.
0
Maria
Top achievements
Rank 1
answered on 16 Apr 2010, 06:41 PM
I'm having performance issues as well, specifically with the Autocomplete feature.  I have enabled virtualization, which solves the problem of the dropdown, but now when you type the response is painfully slow.  I'm binding to several thousand rows, so needless to say, the typeahead feature is necessary.
0
Maria
Top achievements
Rank 1
answered on 16 Apr 2010, 06:42 PM
I forgot to mention that I'm using the Q1 2010 build.
0
Valeri Hristov
Telerik team
answered on 22 Apr 2010, 11:07 AM
Hello Maria,

I was able to reproduce the problem, but we will have to check whether it is possible to optimize the code that searches the items before I promise that we will provide a solution.

Best wishes,
Valeri Hristov
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
ComboBox
Asked by
Nils
Top achievements
Rank 1
Answers by
Valeri Hristov
Telerik team
Nils
Top achievements
Rank 1
Dean
Top achievements
Rank 1
Balaji Shanmugasundaram
Top achievements
Rank 1
Maria
Top achievements
Rank 1
Share this question
or