Hello, I'm configuring a combo using the MVC helper:
@(Html.Infragistics().ComboFor(m => m.LocalAgent) .ID("comboTest") .TextKey("Info") .ValueKey("Description") .FilterExprUrlKey("value") .FilteringType(ComboFilteringType.Remote) .DataSource("http://localhost/API/GetAgents") .Render())
When the view it's rendered the combo doesn't show the value from model. Why isn't it shown? I also have seen that the combo does this ajax request to the server which doesn't have either:
http://localhost/API/GetAgents?textKey=Info&valueKey=Description&toLower=1&compact=1&_=1385716844622
Why is this request made without value?
Another question is: is there a way to pass the params to the request different to oData?.
Thanks!
Hello anbalher,
In this scenario the combo is only going to display the value coming from the model as long as it is matched with a corresponding value in the set datasource. The DataSource property used in this case is looking for a local object as the combo's datasource, and as the call is failing the model data is not displayed.
Therefore I suggest using the DataSourceUrl option to ensure that the combo is bound correctly.
A related example may be seen at:
http://help.infragistics.com/Help/Doc/jQuery/2012.1/CLR4.0/html/Configuring%20ASP.NET%20MVC%20Validation.html
Hope this helps. Please do not hesitate to contact me with any questions.
Thanks for your answer but I've tried with the example from http://www.igniteui.com/combo/load-on-demand.
If I set a default value that is within the first 25 products, the text is displayed : http://jsfiddle.net/F8G78/1/
If I set a default value that isn't within the first 25 products (with selectedItems: [{value: 10827}]) , the text isn't displayed: http://jsfiddle.net/F8G78/2/
¿What should I do to get the text displayed always?