【问题标题】:Grid Binding Error in Kendo grid剑道网格中的网格绑定错误
【发布时间】:2014-06-12 11:25:45
【问题描述】:

我有 ViewBag.ScoringList 作为元素列表,例如:

Scoring_id=1, Code=2,Correlated_To="correlationtext1"

Scoring_id=2, Code=3,Correlated_To="correlationtext2"

我想将它绑定到剑道网格中。

我做了如下:

@(Html.Kendo().Grid(ViewBag.ScoringList)
                            .Name("lvScoring")
                            .Columns(columns =>
                             {
                                // Create a column bound to the ProductID property
                                 columns.Bound(correlatedTo => ViewBag.ScoringList.Correlated_To);

                              })

                            )

但它在columns => 上给了我错误:

Can not use lamda expression as an argument to a dynamically dispatched operation...

如何绑定网格???

【问题讨论】:

    标签: c# asp.net .net asp.net-mvc-4


    【解决方案1】:

    试试这个

    @(Html.Kendo().Grid(ViewBag.ScoringList)
                                .Name("lvScoring")
                                .Columns(columns =>
                                 {
                                     columns.Bound(Correlated_To).Title("Correlated To");;
    
                                  })
    
                                )
    

    【讨论】:

    • 试试这个columns.Bound(p=> p.Correlated_To);columns.Bound(Correlated_To);
    • 这对你有用吗?因为在=> 运算符的右侧有一个表达式或语句。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多