Combobox Performance with many Elements

16 posts, 1 answers
  1. Nils
    Nils avatar
    46 posts
    Member since:
    Jul 2009

    Posted 11 Nov 2009 Link to this post

    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
  2. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 11 Nov 2009 Link to this post

    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.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Nils
    Nils avatar
    46 posts
    Member since:
    Jul 2009

    Posted 11 Nov 2009 Link to this post

    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..



  5. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 13 Nov 2009 Link to this post

    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.
  6. Dean
    Dean avatar
    23 posts
    Member since:
    Nov 2009

    Posted 03 Dec 2009 Link to this post

    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
  7. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 04 Dec 2009 Link to this post

    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.
  8. Dean
    Dean avatar
    23 posts
    Member since:
    Nov 2009

    Posted 04 Dec 2009 Link to this post

    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
  9. Balaji Shanmugasundaram
    Balaji Shanmugasundaram avatar
    1 posts
    Member since:
    Aug 2009

    Posted 17 Dec 2009 Link to this post

    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. 
  10. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 22 Dec 2009 Link to this post

    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.
  11. Nils
    Nils avatar
    46 posts
    Member since:
    Jul 2009

    Posted 04 Jan 2010 Link to this post

    Valeri,
    can you guess when this will be available in an official release (Q3 2009 SP2 / Q1 2010) ?

    Nils
  12. Answer
    Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 04 Jan 2010 Link to this post

    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.
  13. Dean
    Dean avatar
    23 posts
    Member since:
    Nov 2009

    Posted 23 Mar 2010 Link to this post

    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?
  14. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 24 Mar 2010 Link to this post

    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.
  15. Maria
    Maria avatar
    14 posts
    Member since:
    Dec 2008

    Posted 16 Apr 2010 Link to this post

    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.
  16. Maria
    Maria avatar
    14 posts
    Member since:
    Dec 2008

    Posted 16 Apr 2010 Link to this post

    I forgot to mention that I'm using the Q1 2010 build.
  17. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 22 Apr 2010 Link to this post

    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.
Back to Top
UI for WPF is Visual Studio 2017 Ready