Fast loading objects in a DataGridViewComboBoxColumn

Posted on 2007-10-05
Last Modified: 2013-12-17
Im currently having a problem about loading 2000 objects inside a DataGridiewComboBoxColumn. The routin im currently using is very slow. I do a foreach-loop in my collection class, and then add the items one by one. I also tried threading ( but the problem is the column reacts very late while the thread is not yet finished and also the AutoComplete of the column does not normally work until the thread stops. Any ideas on how to fast load lots of objects inside a DataGridiewComboBoxColumn? Help!
Question by:manduz_griffus
    LVL 22

    Expert Comment

    It is not clear whether you are adding 2000 rows to the grid, or 2000 items to a single ComboBox.

    If the former, you might consider implementing paging for your grid - 2000 is a large number of rows.
    If the latter, try


    Author Comment

    hi JimBrandley,

    Sorry for the late reply. I tried what you have suggested, using AddRange, passing an array of the 2000 objects. It is very slighty faster, but is there a faster solution? By the way, i am adding 2000 items to a combobox; a DataGridViewComboBoxCell to be precise. Any more ideas?
    LVL 22

    Accepted Solution

    AddRange() is as fast as it will go. The root of your problem is just putting too many items in the ComboBox. I would call 100 items a large list for a ComboBox. From the perspective of the user, consider how hard it is to scroll through a list of 100.

    I do not know what your application is, but I would expect there might be ways to either page, or perform some grouping, then let the user select the group, and once the group is selected, select from a smaller list that constitutes the membership of that group.

    If you can provide a list of some sample data, or a description of the content of the list, I might be able to help more.


    Author Comment

    Maybe you're right. It is rather incovenient for the user to select an item in a 2000-item combo box. The problem is this combobox is a DataGridViewComboBoxColumn. It is part of a purchase order form where the DataGridView is where the user selects an item, inputs price, etc. The user can type on the DataGridViewComboBoxColumn since AutoComplete is enabled, so selecting an item is not an issue,  loading those items is.

    What im planning now is to pre-load an ObjectCollection in the splash screen and when the PO form is loaded, add the ObjectCollection to the DataGridViewColumn.

    Expert Comment

    This solution is not working for me - I need to display all items in my DataGridViewComboBoxColumn and I have more than 1000 of them. In the ComboBox, there is no problem. So, what to do? The issue was also posted to Microsoft directly, years ago, but nothing happened. I've also tried to change my datasource from data table to string array, with the same slow result. I can create an control by myself, but this will take a lot of time. I guess there some way out of this?

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    A basic question.. “What is the Garbage Collector?” The usual answer given back: “Garbage collector is a background thread run by the CLR for freeing up the memory space used by the objects which are no longer used by the program.” I wondered …
    In my previous two articles we discussed Binary Serialization ( and XML Serialization ( In this article we will try to know more about SOAP (Simple Object Acces…
    The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.
    The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now