I have a Winforms app in which there is a "client" drop-down implemented as a UltraComboEditor. For most users, who are assigned to a specific office, this will have a few dozen entries, and everything is fine. For highly priviledged users, such as those working at the company HQ, every client in the system is available, however. This is on the order of tens of thousands of entries. If I bind this list to a plain Windows.Forms.ComboBox, it remains responsive and usable. The performance of an UltraComboEditor bound to the same list is unacceptable, however. Clicking the drop-down arrow results in a 5-10 second delay, and scrolling is unusable.
Is there anything that I can do to help the performance of the drop-down. Changing to another control isn't really an option, since the highly-priviledged users are a definite minority, and I don't want to break the application for the vast majority of users in order to satisfy just a few. I can't get the plain windows forms combo to match the surrounding UltraComboEditors style-wise, either.
I have tried binding the drop-downs to a List<KeyValuePair<int, string>> thinking that smaller objects might help, but it has made no appreciable difference in the performance of the control. Here is a snippet in which I bind both drop-downs.
clientComboBox.AutoCompleteMode = Infragistics.Win.AutoCompleteMode.Suggest; clientComboBox.AutoSuggestFilterMode = AutoSuggestFilterMode.Contains; clientComboBox.DisplayMember = "Value"; clientComboBox.ValueMember = "Key"; clientComboBox.LimitToList = true;
comboBox1.BackColor = clientComboBox.BackColor; comboBox1.FlatStyle = FlatStyle.Flat; comboBox1.AutoCompleteMode = AutoCompleteMode.Suggest; comboBox1.DisplayMember = "Value"; comboBox1.ValueMember = "Key"; comboBox1.DropDownStyle = ComboBoxStyle.DropDownList; var list = clientLevelSummaries.ToList(); list.Insert(0, new KeyValuePair<int, string>(0, " ")); clientComboBox.DataSource = list; comboBox1.DataSource = list;
Is there anything left to try, other than having one control that looks out of place?
Hi,
In order to determine if there is any way around it, we first need to find out why it's so slow.
The most obvious reason why dropping down the list would be slow is that the Combo is searching the list trying to find an item on the list that matches what's currently in the edit portion. If there is no matching item, then that means the combo has to search the entire list. So, if your combo editor is going to start off blank or null, you might want to make sure that your list contains a null value (preferably at the top) so that the search is fast.
Regarding the scrolling, there are too many unknowns here for me to guess why that part is slow.
Are you binding the combo or populating it in code?
Are you using Images for the items on your list?
What version of the controls are you using?
Can you duplicate the issues you are experiencing in a small sample project?
Displaying that many items on a single combo is not really very useful to a user, anyway, is it? I mean, no human could possibly scroll through such a list to any useful purpose, anyway. Perhaps you should implement some sort of filtering where you only bring back a certain portion of the rows based on a query?
We're using v10.2.
The combo is bound to a List<KeyValuePair<int, string>>, which was the "smallest" thing I could think of to bind it to in order to get better performance out of it. There are no images, or special formatting applied to the items.
As for the number of items in the combo, as I said, the majority of the users see only a few dozen entries. It is only users at the company's HQ that have the access required to see "everything". I can't just make the UI less convenient for the majority of the users in order to placate a few power users. At the same time, it's these power users that are going to complain loudly about the performance of the drop-down.
Typing the first few characters of what the user is looking for would eliminate the need for anyone to actually scroll through the list, and is the expected usage.
Interestingly, I've found that using the UltraCombo instead of the UltraComboEditor, the performance problems are resolved. Now it's just a matter of getting it to look right.