<div>
@(Html.Kendo().PanelBar()
.Name("LeaderPanelbar")
.ExpandMode(PanelBarExpandMode.Single)
.HtmlAttributes(new { style = "width:300px" })
.Items(panelbar =>
{
foreach (var r in Model)
{
float PassKey = r.PassKey;
panelbar.Add().Text(Convert.ToString(r.PassKey))
.Expanded(true)
.Content(@<div style="padding: 10px;">
@Html.Action("PanelItemContent", new { Key = PassKey, sDateRange = ViewBag.SelectedDateRange, sListText = ViewBag.ListText, sCustomEndDate = ViewBag.CustomEndDate, sWidgetTitle = ViewBag.WidgetTitle, sWidgetType = ViewBag.WidgetType, HygieneDelay = ViewBag.HygieneDelay, GracePeriod = ViewBag.GracePeriod, RGracePeriod = ViewBag.RGracePeriod })
</div>);
}
})
)
</div>
然后我必须在面板栏中添加条件以在每个级别显示不同的颜色。