我从这里得到了代码。 http://demos.telerik.com/aspnet-mvc/razor/grid/templatesserverside
@model IEnumerable<Customer>
@{ Html.Telerik().Grid(Model)
.Name("Grid")
.Columns(columns =>
{
columns.Template(
@<text>
<img
alt="@item.CustomerID "
src="@Url.Content("~/Content/Grid/Customers/" + item.CustomerID + ".jpg") "
/>
</text>
).Title("Picture");
columns.Bound(c => c.ContactName).Title("Name");
columns.Bound(c => c.Phone);
})
.Sortable()
.Scrollable(scrolling => scrolling.Height(250))
.Pageable()
.Render();
}
这是我尝试过的。
@(Html.Telerik().
Grid(Model).
Name("Grid").
DataBinding(Function(o) o.SGrid().Select("Index", "Grid")).
Columns(Sub(columns)
columns.Bound(Function(o) o.SGrid).Width(200).Title("SGridName")
columns.Bound(Function(o) o.SGridName).Width(100).Title("SGridName")
columns.Bound(Function(o) o.SGrid).Width(100).Title("SGrid")
columns.Bound(Function(o) o.SGridStopped).Width(100).Title("SGrid")
End Sub).Pageable(Function(o) o.PageSize(3)))
我怎样才能将其重新写入 vbhtml ?
columns.Template(
@<text>
<img
alt="@item.CustomerID "
src="@Url.Content("~/Content/Grid/Customers/" + item.CustomerID + ".jpg") "
/>
</text>
).Title("Picture");