[RESOLVED]Foreign Key in Kendo Grid problem

My IEnumerable<SelectListItem> AssetTypeList has Value and Text.

When the dropdownlist item is selected, it doesn’t send back to the controller. It doesn’t look like it’s binding correctly.

My conjecture would be it doesn’t know to bind AssetTypeId with Value from AssetTypeList.

Anyone know how this can be achieved?

columns.ForeignKey(p => p.AssetTypeId, Model.AssetTypeList, "Value", "Text")

Hi alphabeatsco,

Thanks for your post.

You can try this according to your requirement to modify this:

columns.ForeignKey(p => p.AssetTypeId, (System.Collections.IEnumerable)ViewData["AssetTypeList"], "AssetTypeId", "AssetTypeName")
          //  .Title("xxx").Width(150);

More information:

http://www.telerik.com/forums/binding-foreignkey-to-an-object-other-than-selectlist

Hope this can be helpful.

Best Regards,

Eileen

Leave a Reply