0
我有一個問題,使用Telerik Grid for MVC呈現列模板。我目前使用的最後一個版本:2011.3.1115.340與ASP.NET MVC 3(Razor視圖引擎)無法呈現列模板
這是我的視圖頁面的代碼:
@{
Html.Telerik().Grid<CustomerModel>()
.Name("CustomersGrid")
.DataKeys(keys =>
{
keys.Add(c => c.Id);
})
.ToolBar(commands => commands.Insert().ButtonType(GridButtonType.Text).ImageHtmlAttributes(new {style = "margin-left:0"}))
.DataBinding(dataBinding =>
{
dataBinding.Ajax()
.Select("_SelectBinding", "Customers")
.Insert("_InsertBinding", "Customers")
.Update("_SaveBinding", "Customers")
.Delete("_DeleteBinding", "Customers");
})
.Columns(columns =>
{
columns.Bound(c => c.Id).Width(20).ReadOnly(true);
columns.Bound(c => c.Email);
columns.Bound(c => c.Lastname);
columns.Bound(c => c.Firstname);
columns.Bound(c => c.MobilePhone);
columns.Bound(c => c.EnterpriseName);
columns.Bound(c => c.ManagementComments);
columns.Bound(c => c.IsActivated);
columns.Template(
@<text>
<div>@item.Id</div>
</text>
).Title("Premium");
})
.Editable(editing => editing.Mode(GridEditMode.InLine))
.Pageable()
.Sortable()
.ClientEvents(events => events.OnComplete("Grid_onComplete")).Render();
}
我有模板列「溢價」在我的網格,但它仍然是空的:
http://www.imagup.com/data/1140161102.html
我還沒有測試渲染(),同樣的結果:
@(Html.Telerik().Grid<CustomerModel>()
... blabla ...
columns.Template(
@<text>
<div>@item.Id</div>
</text>
).Title("Premium");
})
.Editable(editing => editing.Mode(GridEditMode.InLine))
.Pageable()
.Sortable()
.ClientEvents(events => events.OnComplete("Grid_onComplete"))
)
感謝您的幫助!