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,
Thank you for posting in our forum! I could suggest you to test this scenario by enabling the LoadOnDemand() feature. The code snippet below shows its implementation:
@(Html.Infragistics().Combo().ID("combo1")
…
.LoadOnDemandSettings(load => load.Enabled(true).PageSize(20))
.Render()
)
Please let me know if this improves the performance enough.
Thanks Dimka. Initially, because there are so many possible results, I wanted to turn off the drop-down feature altogether and use the igcombo only as an auto-suggest box (much like the first example on this page: http://www.igniteui.com/combo/editing).
Do you know if LoadOnDemand can be used if the drop-down is turned off? If not, I think I will allow the drop-down and try the LoadOnDemand feature to see how it feels. Unfortunately, I may not have a chance to work on this feature for a little while, so it may take me some time to experiment with this in my app. In the meantime, I'll go ahead and mark your answer as correct.
Thanks!
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)
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:
.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.