Loading Combobox... Performance Issue..

2 posts, 0 answers
  1. fgalarraga
    fgalarraga avatar
    18 posts
    Member since:
    May 2007

    Posted 24 Nov 2007 Link to this post

    I am trying to load RadCombobox by using the following code.
          foreach (SuperProgram superProgram in SuperPrograms)
                       RadListBoxItem listitem = new RadListBoxItem();
                       listitem.Value = superProgram.ProgramMsg.MenuName;
                       listitem.Text = superProgram.ProgramMsg.MenuCaption;

    It takes long time to load. Whereas in Microsoft's combobox the performance is very good.

    Do I need any additional code??

  2. Nikolay
    Nikolay avatar
    1802 posts

    Posted 27 Nov 2007 Link to this post

    Hello fgalarraga,

    Actually, you need some additional code. There are two ways to speed up the performance of RadComboBox:

    1. Call BeginUpdate at the beginning of the code block that fills RadComboBox with data and EndUpdate at the end of it: 
      foreach (SuperProgram superProgram in SuperPrograms)              
          RadComboBoxItem comboitem = new RadComboBoxItem();              
          comboitem.Value = superProgram.ProgramMsg.MenuName;              
          comboitem.Text = superProgram.ProgramMsg.MenuCaption;              

    2. Set IntegralHeight to True to use RadComboBox data virtualization. Note, that this makes all items in the RadComboBox of equal height: 
      // Set the DropDown minumim size and the amount of items to be shown        
      this.LsvPgramAvail.DropDownMinSize = new Size(0, 20);        
      this.LsvPgramAvail.MaxDropDownItems = 8;        
      // Use the RadComboBox data vitualization        
      this.LsvPgramAvail.IntegralHeight = true;        
      foreach (SuperProgram superProgram in SuperPrograms)           
          RadComboBoxItem comboitem = new RadComboBoxItem();           
          comboitem.Value = superProgram.ProgramMsg.MenuName;           
          comboitem.Text = superProgram.ProgramMsg.MenuCaption;           

      In the current release of our controls there is an issue with the height of the dropdown window, which has already been fixed. Currently, to get a dropdown window with eight items (as shown in the snippet above) you should set the DropDownMinSize property to a value greater than the height of the first item (for example set it to (0, 20)), and then attach to the Shown event of the form and insert these two lines in the event handler: 

      private void Form1_Shown(object sender, EventArgs e)        


    If you have additional questions, do not hesitate to contact us.


    All the best,
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. DevCraft banner
Back to Top