I'm looking at binding a DataTable to the drop down. There are 2 columns (Code and Name) in the DataTable and 1,400+ rows.
Ideally, I want to be able to search as you type. But it seems to take forever to do it. I am binding in code to do this when the page is loaded using the following simple 3 lines:
WebDropDown1.DataSource = ds.Tables(0)WebDropDown1.TextField = "Code"WebDropDown1.DataKeyFields = "Code"
Is there a fast way to do this when running (or any suggestions) ?
Can you display Code and Name in the dropdown portion? I've looked at the WebCombo which pretty much displays what I want but is slow also - and I can't see how to implment search as you type.
Any pointers would be good thanks.
I'm wondering if there is any improvement to the WebDropDown since Andez post? I agree with Andez that the WebCombo has much better performance. The typeahead functionality works, there are no delays in finding data and can handle large datasets. I have been setting different properties as you've outlined and can find no combination of them that makes the WebDropdown work efficiently with a dataset that has 3000 records.
Did you try EnableLoadOnDemand=true, and set some PageSize value , say 200 or 300 , even 500 ? Performance should be pretty good in that case.
Also by Typeahead support I assume you have set EnableAutoFiltering=Server.
By the way, in the WebCombo if you have the following set:
Webcombo1.DropDownLayout.RowsRange = <some number>;
it's essentially the same as enabling LoadOnDemand and setting PageSize=<the same number>;
I've had a bit more play with the combos today. I was getting reasonable performance from each, but then went a little mad by adding lots of data to each. I've compared both and they both offer good performance.
I've put together some sample code which I will upload if anyone is interested. I will post my results also of the comparison when I get a chance.
I've only just noticed that some script errors were occuring when I was clicking on the drop down (both WebCombo and WebDropDown) which I have never noticed before so don't know if I'm going mad cos it has been a long day or I have set some properties somewhere that may form a bad combination.
From todays tests, the only drawback of the WebDropDown appears to be it only displays single column of data.
This is really cool that you have done this research , thanks :)
By the way you can have multi-column WebDropDown as well. There are two ways to do this:
1) to use ItemTemplate, or even different Template for each item
2) to have 1 item which will be assigned a WebDataGrid template, i.e. you can have a WebDataGrid inside the dropdown.
There are samples for both of these approaches at samples.infragistics.com => 2009.1 => WebDropDown => Templates.
I did try all your suggested, although my Pagesize was set to 20. I changed it to 400 and performance is much better. I set EnableAutoFiltering=Server. Although right now that's not working. I'm not getting any suggested matches beyond the first page. I'll keep fiddling with it though.
Thanks for responding.