We are using wbdropdown to show a list of NDC medications. The user will select one and only one medication from the list. We are interested in the user having type-ahead functionality.
The master list is >24000 items which presents performance problems loading the page. can we delay binding of the webdropdown until the user has typed in 3 characters, and then use those 3 characters as a filter in the underlying query? How?
Thanks!
Hi johnnvrsm,
Thank you for posting in the community.
You requirement may be achieved by handling the AutoFilterStarting clientside event which may be cancelled if the current value of the control is shorter than n characters. For instance:
Please note that you may also control the rate with which the items are filtered by modifying the AutoFilterTimeoutMs in order to defined the interval before a filtering request is sent to the server:
http://help.infragistics.com/NetAdvantage/ASPNET/2011.2/CLR4.0/?page=Infragistics4.Web.v11.2~Infragistics.Web.UI.ListControls.WebDropDown~AutoFilterTimeoutMs.html
Hope this helps.
Thanks. I've added this, but the control is still databinding on page load which takes a very long time as it is loading all 24000+ items in the datasource. How do I stop this?
See my code below:
<ig:WebDropDown ID="wddMedications" runat="server"
Width="200px"
DropDownContainerWidth="300px"
DropDownContainerHeight="500px"
DataSourceID="sdsMedications"
TextField="medication_dispensed"
ValueField="generic_product_id"
EnableAnimations="false"
Height="18px"
Button-ImageUrl="~/ig_res/Default/images/windows_DropDownButton.png"
Button-HoverImageUrl="~/ig_res/Default/images/windows_DropDownButton.png"
Button-PressedImageUrl="~/ig_res/Default/images/windows_DropDownButton.png"
CurrentValue="-- Select --"
AutoPostBackFlags-ValueChanged="On"
OnSelectionChanged="wddMedications_SelectionChanged"
ClientEvents-ValueChanged="wwdMedications_ValueChanged"
EnableAutoFiltering="Server"
ClientEvents-AutoFilterStarting="wddMedications_AutoFilterStarting"
TabIndex="1">
function
wddMedications_AutoFilterStarting(sender, e) {
(eventArgs.get_value().length < 3) {
eventArgs.set_cancel(
);
Hi johnvrsm,
Thank you for your reply.
I suggest that you enable load on demand for your WebDropDown in order to increase performance. A detailed guide on how this can be achieved is available at:
http://help.infragistics.com/NetAdvantage/ASPNET/2011.2/CLR4.0/?page=WebDropDown_Load_on_demand.html