我在Razor View中循环浏览我的模型,并希望显示多个Kendo网格。但是,即使在循环发生时正在执行Item_Read,我也会获得所有空网格。
有什么想法吗?
来源:
@foreach (var itemM in Model)
{
<tr>
<td>
@Html.DisplayFor(modelItem => itemM.id)
</td>
<td>
@(Html.Kendo().Grid<SomeOtherModel>()
.Name("KendoGrid" + itemM.id)
.Columns(columns =>
{
columns.Bound(p => p.title);
columns.Bound(p => p.details);
})
.AutoBind(true)
.DataSource(dataSource => dataSource
.Ajax()
.Model(model =>
{
model.Id(p => p.itemId);
model.Field(p => p.itemId).Editable(false);
})
.Read(read => read.Action("Item_Read", "Controller", new { id = itemM.id }))
)
)
</td>
</tr>
}
答案 0 :(得分:0)
问题是我的ViewModel,其中一个属性是null。