views:

493

answers:

5

Hi everyone. Im building a small form using ComboBoxes with lots of items, and it seems after exactly 510 items added, the ComboBox stops working, and the combo button is hidden.

Is there any maximum number of items that can be added? Or this might be other problem?

Thanks in advance

+1  A: 

Firstly, with that many items in a combobox you should redesign your screen. Once you get over a certain number of items, it is faster for the user to write something into a text box.

Having said that 510 is not a round number so the problem is probably not with the combobox. I would guess that at that point the payload for however you are getting the items becomes larger than the configuration allows, the combo does not get all the information it was expecting and therefore hangs waiting for the info.

Shiraz Bhaiji
+1, 510 is way too many for a combobox.
tsilb
But the combo box is also a text box, with sugestion and everything... I have seen it in plenty of sites to select countries for example. I think you are misunderstating the funcionality of the combo box. Check this http://www.asp.net/AJAX/AjaxControlToolkit/Samples/ComboBox/ComboBox.aspx.Back on the question, i get the items from the database with a SP. To be more specific, the items are all the cities from my region.
Tom S.
@Tom, how do you get the data from the SP to the browser, I guess you must have a JSON service, how is it implemented?
Shiraz Bhaiji
I attach the items to the ComboBox in the code-bedind, something like this: "cbCities.DataSource = GetCitiesFromDB();" (this method calls the SP and returns a DataTable).
Tom S.
A: 

I'd recommend you use a combination of controls to filter your items into smaller groups. For example, if you have 500 cars, you could filter by manufacturer (in a combobox) and make (in another combobox).

tsilb
Im already filtering by regions, however there is regions with lots of cities, the maximum is 600 i think.
Tom S.
Maybe filter by state (Which people may be more familiar with than some ideas of a "region")?
tsilb
Depends on the country where you live. State doesnt mean much here :)
Tom S.
A: 

Would it be possible for you to break the list down into categories and use more than one ComboBox? If you added a dropdown to choose the category (geographic region, product group, or some other filter), then the user could choose a category. That would be applied to filter the list displayed in the original, second ComboBox. That would make a much better UI, and you'd be passing a lot less data to the browser.

I'm thinking of the Cascading DropDown demonstrated here.

DOK
Im already doing it with comboboxes =) However with a specific set of values i got nearly 600 items on the last combo.
Tom S.
This is exactly what I'm talking about. Also, just because you are already doing it one way doesn't mean you shouldn't consider doing it another way. Do it the right way now and save yourself a lot of pain later :)
Brian T Hannan
Hehe well said... However i get this logistic information from my national Postal Service, and i cant see how i can partitionate more the information, that is already partitioned (there was around 24000 tows). Maybe doing a map or something, but for what im payed for, its just not worth it :P
Tom S.
+1  A: 

I just tried an AJAX ComboBox with 10000 items and it worked fine, although it took a long time to load (about 10 seconds). So there is not a limit at 510 items. Your problem must be something else.

Mark Byers
Hmmm, thanks for the test, i guess the problem is mine then, probably CSS. I just cant figure out where, but i will make some more tests.
Tom S.
A: 

Your problem might have to do with Internet Explorer. We had a similar problem couple months ago, where we wouldn't have any problem with it in Firefox or Chrome, but when we were to show the combobox on IE, the screen would freeze and it would start responding again in a couple minutes.

Whether you need a combobox that big is another issue which doesn't have to do with your question, so I'll try to answer :)

Please take a look at this article http://kemcik.blogspot.com/2009/11/very-slow-updatepanel-refresh-when.html

Emrah