私はMVC3が初めてです。私の仕事は、1 つのビューで 2 つの部分ビューをレンダリングすることです。データのリストは、Telerik Grid の各部分ビューに表示されます。そして、両方の部分ビューを 1 つのレベル、つまり 1 つの行に表示したかったのです。PanelBar() を使用しようとしましたが、部分ビューが行ごとに表示されます。以下のように結果を表示したい:
@using EY.Benchmarking.Entities.Administration;
@model IEnumerable<Measure>
@{
ViewBag.Title = "Roles";
int PageSize = 10; // This needs to be fetched from a global variable
}
@(
Html.Telerik().Grid(Model)
.Name("RoleList")
.DataKeys(dataKeys => dataKeys.Add(o => o.MeasureID))
.DataBinding(dataBinding => dataBinding
.Ajax()
.OperationMode(GridOperationMode.Client) // <-- set the operation mode
.Select("RoleList", "RoleMapping")
)
.Columns(columns =>
{
columns.Bound(o => o.MeasureID).Visible(false);
columns.Bound(o => o.MeasureName);
})
.Pageable(paging => // Set the pagingation and associated propeties
{
paging.PageSize(PageSize).Style(GridPagerStyles.NextPreviousAndInput).Position(GridPagerPosition.Bottom);
})
.Sortable()
.Reorderable(reorderable => reorderable.Columns(true))
.Resizable(resizable => resizable.Columns(true))
.Filterable()
.HtmlAttributes(new { style = "width: 500px;" })
)