Skip to content

Infragistics Community Forum / Desktop / Ultimate UI for Windows Forms / How to add items manually in combobox.

How to add items manually in combobox.

New Discussion
Jay
Jay asked on Feb 25, 2011 3:31 PM

I have collection of object,which contains 6-7 properties.Collection having over 30,000 records.If i go by giving collection to the datasource of combobox,then it will tell lot of time,as it will represent it as a grid.then i have to hide some column and …inshort this process will take lot of time.Instead of this i want to add 30,000 records manually,by adding combobox.item.add(key,value),or something like that.

I read in the forum,there you cannot add items manually,you must have to give datasource.

Can you suggest me anything(like dictionary etc…) that will take less time to process?

Thanks,

Jay Parikh.

Sign In to post a reply

Replies

  • 0
    Mike Saltzman
    Mike Saltzman answered on Sep 12, 2008 2:41 PM

    Hi Jay,

    I doubt that copying the data from a Collection into some other structure will save you any time. In fact, it will probably just take longer because you not only have the binding time, but you are adding the time it will take to copy the data. 

    Binding a ComboBox to 30,000 items shouldn't really take that long. Have you explored why it's taking so long?

    In any case, it's not really a good idea, because no user I have ever known will be able to deal with a list of 30,000 items. Scrolling through such a huge list wouldn't be very useful to anyone. Perhaps what you need to do is implement some kind of filtering mechanish where the list only contains a certain sub-set of the data at any one time. Perhaps you cold give the user a choice of categories and then populate the list based on the category they chose. I don't know your application or the data you are dealing with, so I don't know if that will work, of course. 

    • 0
      Jay
      Jay answered on Sep 12, 2008 3:28 PM

       Hi Mike,

      It is not taking time to bind the data.It is taking time to display those data,as it will prepare grid for 30,000 rows with 6-7 columns.I have check that if i am binding 1000 records then its coming very quickly.So,its all about records(i mean Grid).May be i can use another control which supports adding items manually?not sure.

      The scenario you told me to divide it in category or something is not possible in my application.

      Thanks for the reply.

      I will check further,what can be the solution.

      Thanks,

      Jay Parikh.

      • 0
        Mike Saltzman
        Mike Saltzman answered on Sep 15, 2008 2:39 PM

        Hi Jay,

        [quote user="jaysparikh"]It is not taking time to bind the data.It is taking time to display those data,as it will prepare grid for 30,000 rows with 6-7 columns.I have check that if i am binding 1000 records then its coming very quickly.So,its all about records(i mean Grid).May be i can use another control which supports adding items manually?not sure.[/quote] 

        I don't understand what this means. You mean it takes time the first time you drop down the list? How exactly are you making the distinction between binding and displaying? 

        If it's a question of the Combo processing the data, the only thing I can think of that might cause a delay like this is the DropDownSearchMethod property. By default, the Combo does binary searching. But this means that it has to build a sorted list of the DisplayMemmer column values. So try switching this property to linear. This will slow down searching the list, but it will improve the initial load time of the control, so it's a trade-off. 

      • 0
        David
        David answered on Oct 31, 2008 5:09 PM

        I'm new to Infragistics and I'm trying to learn how to use some of the controls.  Is there a way to add items to the ultracombo like with the Microsoft combo?  Ex:

        Combobox1.Items.Add("String");

        Or, can you only add items to the ultracombo by using a datasource?

        Is there a book that contains more information on the Infragistics controls?

        Thanks in advance.

      • 0
        Mike Saltzman
        Mike Saltzman answered on Nov 3, 2008 3:41 PM

        UltraCombo requires a data source.You can use any object which implements IList or IBindingList as the data source, though. So you could use a DataTable, a List<T>, a BindingList<T>, and UltraDataSource, or many many other objects for your data. 

        If you don't want to do that, then I recommend using the UltraComboEditor instead of UltraCombo. The UltraComboEditor is a simpler, single-column combo, that more closely resembles the Microsoft ComboBox. 

      • 0
        Ashok
        Ashok answered on Dec 30, 2008 5:37 AM

         which is the the better way to add items manually that is type of data source with some more detal… thanx.

      • 0
        Mike Saltzman
        Mike Saltzman answered on Jan 5, 2009 3:13 PM

         I'm sorry, but I do not understand your question.

      • 0
        Cristopher
        Cristopher answered on Dec 3, 2008 4:39 AM

        But an ultracombo is different from a ComboBox!!!

      • 0
        Mike Saltzman
        Mike Saltzman answered on Dec 3, 2008 3:27 PM

        [quote user="ctp59"]But an ultracombo is different from a ComboBox!!![/quote] 

        Yes, it is different. What's your point? 🙂

      • 0
        Stephane
        Stephane answered on Jul 1, 2010 4:52 PM

        Hi Mike,

        Sorry for my English.  I use Infragistics and Entity Framework in my WinForm c# project.  I have a performance problem about binding data to UltraCombo and WinGrid via DataSource property.

        Here is the part the source code in question :

               List<RefStatutPersonne> elems = this.Entities.RefStatutPersonnes.ToList();
               _ultraCombo_StatutPersonnes.DataSource = elems;
               _ultraCombo _StatutPersonnes.DisplayMember = "Nom";
               _ultraCombo _StatutPersonnes.ValueMember = "ID";

        To retrieve data is fast but the slowness occurs when I assign the elems variable to DataSource property.  The elems variable has only 13 records and the binding time is very slow.

        Have you idea?

        Do it exists performance consideration to apply to binding data to Infragistics with Entity Framework?

        I work with Visual Studio 2010 and NetAvantage 10.1 CLR2x.

        Thank you

        Stéphane

      • 0
        Mike Saltzman
        Mike Saltzman answered on Jul 12, 2010 3:15 PM

        Hi Stéphane,

        I can't see any reason why this should be slow, unless maybe your data source has a recursive data structure.

        The first thing I recommend is that you take a look a the WinGrid Performance Guide. In particular, check out section 4 on Recursion.

         

      • 0
        Aridane
        Aridane answered on Feb 25, 2011 12:10 PM

        I am having the same problem with 3 elements in the list, and no its not a recursive list.
        And no i dont have a DropDownSearchMode property or anything like this…

      • 0
        Mike Saltzman
        Mike Saltzman answered on Feb 25, 2011 3:31 PM

        [quote user="aralmo"]I am having the same problem with 3 elements in the list, and no its not a recursive list.
        And no i dont have a DropDownSearchMode property or anything like this…[/quote]

        What problem are you having, exactly? Are you saying that adding 3 items to the list is taking a long time? If that's the case, then my best guess would be that something you are doing is causing Exceptions that are being caught and handled.

        Can you duplicate this in a small sample project and post it here?

  • You must be logged in to reply to this topic.
Discussion created by
Favorites
Replies
Created On
Last Post
Discussion created by
Jay
Favorites
0
Replies
13
Created On
Feb 25, 2011
Last Post
15 years, 7 months ago

Suggested Discussions

Created by

Jay

Created on

Feb 25, 2011 3:31 PM

Last activity on

Feb 23, 2026 8:32 AM