Convert lambda expression to Json in MVC

拜拜、爱过 提交于 2019-12-02 11:22:48
Petur Subev

I assume this happens because there is no property called MyRegionName for the Student class.

You have two options

1) Create a ViewModel that looks like your Student model but make it has such property. Also make sure inside the projection function of the ToDataSourceResult you create those new ViewModel types instead of anonymous object.

2) Just use a Template column. e.g.

columns.Template(@<text></text>).Title("MyRegionName").ClientTemplate("#=MyRegionName#");
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!