Hello,
I'm trying to wrap my head around the performance considerations for using large data sets with the igcombo. To provide a little context, here's my relevant View code:
@(Html.Infragistics().ComboFor(model => Model.BrandName) .DataSourceUrl(Url.Action("BrandAutocomplete")) .Width("24%") .HtmlAttributes(new System.Collections.Generic.Dictionary<string, object>() { { "class", "col-md-6 item-search-input" } }) .ValueKey("BrandId") .TextKey("BrandName") .ShowDropDownButton(false) .FilteringType(ComboFilteringType.Remote) .FilterExprUrlKey("filter") .FilteringCondition("contains") .RenderMatchItemsCondition(ComboRenderMatchItemsCondition.Contains) .DataBind() .Render() )
The problem is that approximately 35,000 results will be returned from the BrandAutocomplete action. This makes the combo box completely unusable since each letter typed results in a "contains" search of 35,000 records.
Of course, the problem is not really with the igcombo itself, but with my particular business case. However, I was wondering if anyone else has needed to use igcombo with a large data set, and if so, are there any ways that I can work with igcombo to make the control feel more usable? Am I trying to force a control to do something that it isn't really designed to do? Are there perhaps ways that I can structure my controller action to query the database more efficiently (my ORM is Entity Framework 6)?
Thanks in advance for any advice you have!
Hello Kyle,
Do you need any further assistance? If so, feel free to contact me again.
Thank you for your reply.
You might test igCombo by setting the AutoComplete feature to true.
@(Html.Infragistics().Combo().ID("combo1").Width("200px")
…
.RenderMatchItemsCondition(ComboRenderMatchItemsCondition.StartsWith)
.AutoComplete(true)
.LoadOnDemandSettings(lod => lod.Enabled(true).PageSize(2))
.ShowDropDownButton(false)
.Render()
)
Please note that since you have the load on demand option enabled only the items which are already loaded on the client would be used for suggesting.
Let me know if this fits your requirements.
Thanks Dimka. Using LoadOnDemand really helped from a performance point of view. One last question, and then I think I'll have everything I need. Is there a way to have the igcombo only auto-suggest after a certain number of characters have been typed?
I am just following up to check if you have any additional questions. If so, feel free to contact me again.
The auto-suggest box is implemented by hiding of the drop-down button. Load on demand and the drop-down button hiding are compatible features. You might try something like that:
@(Html.Infragistics().Combo().ID("combo1")
.LoadOnDemandSettings(load => load.Enabled(true).PageSize(2))
When you test your project let me know if this works for you. If any additional questions arise feel fre to share them in this thread.
Looking forwards to your reply.