0
我使用kendo選項卡條並嘗試顯示模型集合中每個項目的選項卡。kendo tabstrip ArgumentOutOfRangeException
@if (Model.Entities.Count > 1)
{
@(Html.Kendo().TabStrip()
.Name("tabstrip")
.Items(items =>
{
for (int i = 0; i < Model.Entities.Count; i++)
{
items.Add()
.Text(Model.Entities[i].Name)
.Selected(i == 0)
.Content(@<div>
@Model.Entities[i].Name //causes exception
</div>
);
}
})
)
}
在選項卡內容的標記(@ Model.Entities [I]請將.Name)導致異常。
ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index
有沒有人知道我在做什麼錯或如何正確實施它?
謝謝它的工作原理 – AGuyCalledGerald