Column ComboBox .NET 2.0 DataGridView - Slow displaying items

Any suggestions for improving the quality of the DataGridViewComboBoxColumn with large itemsets?

I have a DataGridView with multiple columns of type DataGridViewComboBoxColumn. I am binding these combobox columns to a fairly large collection (10k + items). As a result, it is very slow to display the items (when I click the down arrow button on the cell, it takes about 10 seconds to display the items).

I have tested the same set of items with a standard ComboBox control and it works really fast.

Any ideas?

Thank.

+1


source to share


3 answers


The best way is to vote the connection request about it on MS connect :)



0


source


A much better solution is to populate an array of strings with values ​​from the database and set the column data source to null, then set the Items property of the column to the array of values ​​that you populate. This way it doesn't query the database every time it populates the combo box. Hope this helps.



+2


source


Are you data binding to 10k objects in combo boxes or data grid?

In any case, you should consider the usability of your design.

If its in the data grid use paging and reduce the size of the associated data source to a more reasonable size.

If it's in a combo box, your solution can't be used. You would be better off giving your users an autocomplete box like the one from the ajax toolkit ( http://www.asp.net/AJAX/AjaxControlToolkit/Samples/AutoComplete/AutoComplete.aspx ) or a popup though they can page or search though yours 10k elements.

-1


source







All Articles