由于条件,在mvc telerik网格中绑定一列

时间:2011-03-23 12:21:03

标签: model-view-controller binding grid telerik

我有一个带服务器绑定的telerik mvc网格

我想根据条件绑定一个列:我做了  columns.Bound(p =>                                 {                                     if(Helper.Language.StartsWith(“en”))                                     {                                        p.Patient.FirstNameEnglish;                                     }                                     其他                                     {                                      p.Patient.FirstName;                                     }                                 })

但它给出了这个错误“无法将lambda表达式转换为'string'类型,因为它不是委托类型”

1 个答案:

答案 0 :(得分:0)

解决方案

if(Helper.Language.StartsWith(“en”)) {    columns.Bound(p => p.Patient.FirstNameEnglish); } 其他 {    columns.Bound(p => p.Patient.FirstName); }