Click here to Skip to main content
15,849,996 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

I am trying to bind a data set which has single column whose count is nearly 2lakhs. Now, when I tried to binding this datatable to Combo box its taking much time...more over my application is moving to "Not Reaponding State" for some time. Can any one suggest me to over come the issue.

Source Code:


this.ClassCodeComboBox.DisplayMember = classCodeDataTable.ClassCodeColumn.ColumnName;<br />
                    this.classCodeDataTable = this.form26000Control.WorkItem.F26000_ClassCodeDetails(parcelId).f26000ClassCode;<br />
<br />
                    if (classCodeDataTable.Rows.Count > 0)<br />
                    {<br />
                        this.ClassCodeComboBox.AutoCompleteMode = AutoCompleteMode.Suggest;<br />
                        this.ClassCodeComboBox.AutoCompleteSource = AutoCompleteSource.ListItems;<br />
                        this.ClassCodeComboBox.DataSource = classCodeDataTable;<br />
                        this.ClassCodeComboBox.Text = this.classCode;<br />
                        this.ClassCodeComboBox.Select(this.ClassCodeComboBox.Text.Length, 0);<br />
                    }



Win forms Application Frame work 3.5, Used Control:Combobox
Posted
Comments
[no name] 13-Aug-14 10:40am    
You over come this issue but only loading a reasonable number of items. Do you really think that someone would want to scroll through whatever number 2lakhs is? I know it's a lot and no reasonable human being wants to read through all of that data.

The solution is simple: don't try to load any UI element with that many items.

Think about it: how you like to use that software and try to find the one selection you need to use in a list of 200,000 other ones? Every day? Probably several times every day?

If I tried that, my users would hate me, not use my software, and I wouldn't get paid.

Find a solution that lets them find what they need easier: filters, groups, whatever - but don't be so lazy! :laugh:
 
Share this answer
 
I would crib from the jQuery autocomplete here and run a search on the server side for every x characters entered, for instance the autocomplete is inactive until 4 characters are entered, and then will populate with a filtered list. That way you have a filtered result coming in which will be substantially more refined and will not make your users rise up as a lynch mob.

This does mean that you'll need to add a service that will provide the filtered content and assign that as your data source. I'm afraid I can't tell you how best to do that off the top of my head in Web Forms, but I can tell you that in MVC it would be trivial.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900