Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1845
MVC Helper - DataSource excluding object properties
posted

In my MVC Helper, I'm assigning an object with 4 properties to the igCombo.DataSource, and referencing those properties by name in igCombo.ItemTemplate string, as the examples show.

However, it seems that the helper, during rendering, strips the datasource of all properties except the one's assigned to "TextKey" and "ValueKey", or, if neither is assigned, the first property in the datasource.  Is this by-design?  If so, how do I get around it?

The control renders perfectly if I pass the datasource as json and then initialize it client-side, but once again, it seems the behavior for the MVC Helper is different than the jQuery behaivior, and the only documentation I found uses a URL as the datasource:

http://samples.infragistics.com/jquery/combo-box/templating

 

 

Parents
No Data
Reply
  • 24497
    Verified Answer
    posted

    Hi Josh,

    By default the helper for Mvc Combo passes to client only data related to ValueKey and TextKey (if it is defined). Without that optimization and large number of columns in original dataSource, the size of html passed to client might be dramatically increased and slow-down performance.

    If application needs all original server data available on client, then it should enable that by using CompactData.

    In case of helper without ComboModel:
    ...ComboFor(...)....CompactData(false).Render()

    In case of ComboModel:
    comboModel.CompactData = true;

Children