我将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...
我如何绑定网格???
答案 0 :(得分:1)
试试这个
@(Html.Kendo().Grid(ViewBag.ScoringList)
.Name("lvScoring")
.Columns(columns =>
{
columns.Bound(Correlated_To).Title("Correlated To");;
})
)