views:

1602

answers:

3

Hi,

Any suggestions on how to improve DataGridViewComboBoxColumn performace with large item sets?

I've got a DataGridView with several columns of type DataGridViewComboBoxColumn. I'm databinding those combobox columns to a rather large collection (10k+ items). As a result it's very slow to display the items (when i click on the down-arrow button on a cell it takes about 10 seconds to display the items).

I've tested the same collection of items with a standard ComboBox control, and it works really fast.

Any ideas?

Thanks.

A: 

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

Tamir
A: 

Are you data binding 10k items to the combo boxes or the data grid?

Either way you should think about the usability of your design.

If its to the data grid then use paging and cut the size of the data source bound to a more reasonable size.

If its to the combo box then your solution can't be usable. You'd be better 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 which they can page or search though your 10k items.

Keith K
+1  A: 

A much better solution is to populate a string array with the values from the database and set the column datasource to null, then set the Items property of the column to the array of values you populated. This way it does not requery the database each time it populates the combobox. Hope this helps.

Micah Rowland