ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
Cannot bind child/navigation properties on grid column
Title:
B
I
{code}
?
Hi, i'm using Awesome MVC 5 but can't get my child properties to be shown in grid. I followed the examples with Binding "ChildObj.Propertyname" notation but nothing is shown. Grid: new Column { Bind = "Service.Id", Width = 95, Header = "Srv. Ident" }, Json, returned by the server - all data exists in the json object but no property will be shown in the grid. What could i have missed to get this working? "dt": { "h": null, "gs": null, "it": [{ "Id": 2, "Service": { "Id": 8303, ... ... } }], Thanks for some feedback. M Strojek
Save Changes
Cancel
Martin Strojek
asked at 29 Jun 2017
you need to set `GridModelBuilder.Map` and create a property like `ServiceId = Service.Id` and after in the column use `ClientFormat = ".ServiceId"`, have a look in the demos it's used a lot; http://aspnetawesome.com/learn/mvc/Grid#Map
at 29 Jun 2017
Omu
Thanks a lot - sure i already used mapping in the controller but did not get that the child properties are not available unless separate mapping to some property. In http://aspnetawesome.com/learn/mvc/Grid it looks like you just can use ChildObj.ChildProperty as Bind parameter
at 30 Jun 2017
Martin Strojek
Answers
please
Sign In
to leave an answer
By accessing this site, you agree to store cookies on your device and disclose information in accordance with our
cookie policy
and
privacy policy
.
OK