RadComboBox is slow

7 posts, 0 answers
  1. acola
    acola avatar
    15 posts
    Member since:
    Aug 2006

    Posted 16 May 2007 Link to this post

    I have a DataTable that I am setting as the datasource of a RadComboBox. The DataTable has about 1300 entries in it. If I use the standard Windows ComboBox, Autocomplete works quickly, and I have no issues with it. If I try to use the RadComboBox, the first time I enter the field and start typing, the first letter auto-completes fine, but it hangs for 5-10  seconds upon typing the second letter into the field, before it matches values for autocomplete. And  if I click the arrow to display the drop-down list, the form kind of hangs, until I click around for a bit.   Any idea what is causing this, and what I can do to avoid it? No way I can expect my users to put up with that.
  2. acola
    acola avatar
    15 posts
    Member since:
    Aug 2006

    Posted 17 May 2007 Link to this post

    To add more information, setting the datasource of the RadComboBox to a filtered data view is painfully slow (like, check a couple websites, take a phone call, get a cup of coffee, then a minute later the form comes back kinda slow).  The line where it hangs is at the setting of the DataSource to the DataView.

    Below is my code for filtering the RadComboBox, based on a selection from another RadComboBox. Again, when I use the standard Windows combo box, performance is lightning fast.

    Dim id As String = cmboOffAgency.SelectedValue 
    Dim filterExpression As String = "AgencyId = " + CStr(id) 
    cboOfficer.DataSource.DefaultView.RowFilter = filterExpression 
     
    'Gets the number of records in the DataView after 
    'RowFilter and RowStateFilter have been applied. 
    If (cboOfficer.DataSource.DefaultView.Count > 0) Then 
       cboOfficercboOfficer.DataSource = cboOfficer.DataSource.DefaultView 
    End If 

  3. UI for WinForms is Visual Studio 2017 Ready
  4. Angel
    Admin
    Angel avatar
    121 posts

    Posted 18 May 2007 Link to this post

    Hi Anne Comes,

    You can accelerate the filtering process with few lines of code before and after applying the filter. We provided a small example for you (cmboOfficer is the bound combobox to be filtered) :

    Before setting RowFilter or changing the DataSource:
    Dim popupControl As RadControl = Me.cmboOfficer.Items(0).ElementTree.Control
    Dim listBox As RadListBoxElement = popupControl.RootElement.Children(0).Children(0)
    listBox.Viewport.SuspendLayout()


    ...
    (setting the RowFilter or changing the DataSource)
    ...

    After setting RowFilter or changing the DataSource:
    listBox.Viewport.ResumeLayout(False)

    Our combo box allows rich visualizations of its child elements but it comes with a price in this case the performance. We are constantly working on optimizing and improving the performance of all our controls.
    Tell us whether the provided solution helped to solve the performance issues.

    Kind regards,
    Angel
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  5. PortVista
    PortVista avatar
    61 posts
    Member since:
    Oct 2006

    Posted 21 May 2007 Link to this post

    It's very slow for me too, just doing a simple thing like populating it with Countries or States, suspends the whole layout, and then takes a second for the drop down to appear. For me, I'd like to see a FASTER control than Microsoft's, not slower.

    I get index out of range on the first line of that code:

                Dim popupControl As Telerik.WinControls.RadControl = Me.cbCountry.Items(0).ElementTree.Control 
                Dim listBox As Telerik.WinControls.UI.RadListBoxElement = popupControl.RootElement.Children(0).Children(0) 
     
                Me.cbCountry.DataSource = dsCountryGlobal.CountryRegion 
                listBox.Viewport.SuspendLayout() 

  6. Angel
    Admin
    Angel avatar
    121 posts

    Posted 22 May 2007 Link to this post

    Hello Jason,

    Thank you for the feedback.

    We are not sure that we will be able to beat Microsoft ComboBox in performance, as it is just a wrapper for the native combo. It is very hard for a managed control to beat performance of the native one, especially when offering several features which are not supported by the standard control (for instance, the ability for theming, animation, image in items support, allows for different items to have different height, gradients, etc). Excellent performance is one of our main goals and we are constantly working in this direction. Hopefully we will be able to be very close to the standard control with the next major version. Still, if performance is what you are after, you will be better off with using the regular MS controls.

    As to the error, you will need to put the first line of code after the DataSource of the combo is filled with data for the first time. In the "Form_Load" event handler you should have automatically generated a line of code that fills the table which gives data to the combo. After that line is executed you can call the code we gave you. Otherwise the combo will not have items and "Items(0)" will throw an exception...

    I hope this helps.

     
    All the best,
    Angel
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  7. Karl
    Karl avatar
    172 posts
    Member since:
    Sep 2010

    Posted 13 Jul 2011 Link to this post

    I know this is an old post but have just come across the same issue in the ASP.Net version of the control.

    We have a radComboBox on our site which, while in development, has worked perfectly. Now we have gone to the testing stage and discovered that for some clients this control will be populated with over 5000 entries.

    We use the OnItemsRequested method to populate the control at runtime. This method checks to see if the entries have been retrieved previously and, if they haven't, gets them from the data source, saves them into the viewstate, and then loads them into the control. This takes around 300 ms.

    Filtering has been set to "contains" and once the control has been populated and we start to type our search criteria into it, it just stalls after I manage to get 2 characters of my search string entered and it does this for around 45 seconds. I then get a message saying the script is taking too long and asks if I'd like to stop processing it! If I select no (to carry on processing) I have to wait a further 30 seconds or so until I can enter the next character and so on.

    Does anyone have anyidea how to speed up the filtering? The date this post first brought up the issue was in 2007 and I would have thought it would have been fixed by now. It just seems to me to be a bit weak and when it's tested with some meaty data it fails miserably.
  8. Dimitar Terziev
    Admin
    Dimitar Terziev avatar
    1266 posts

    Posted 18 Jul 2011 Link to this post

    Hi Karl,

    Could you clarify whether this lack of performance is experienced in all browsers or just in particular ones.

    Regarding your problem with the filtering, in general this functionality is used when you have your data loaded and just working with it on the client-side. When load on demand is used, the approach is to load only items based on the text entered in the input.

    Regarding the filtering, when working with large amount of items, there may be some delays since the whole list of items is iterated when you write text in the input in order to show only the items which are filtered.

    My suggestion is to open a support ticket so we could discuss your particular problem and try to find a solution for it.

    Best wishes,
    Dimitar Terziev
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Back to Top
UI for WinForms is Visual Studio 2017 Ready