Hi Telerik,
I'm usingASP.NET MVC Grid and I want using Column Template in server side but it's not working with my code:
<
div
id
=
"clientsDb"
>
@(Html.Kendo().Grid<
vw_Products
>()
.Name("grid")
.Columns(columns =>
{
columns.Template(item => "<
img
class
=
'product-photo'
src
=
'" + ImageModel.GetThumbnail(item.Images) + "'
alt
=
'" + item.Title + "'
/></
td
>")
.Width(140).Title("Picture");
columns.Bound(c => c.Title).Title("Product Name").Filterable(ftb => ftb.Cell(cell => cell.Operator("contains")));
columns.Bound(c => c.Price).Title("Price").Width(300).Filterable(ftb => ftb.Cell(cell => cell.Operator("gte")));
})
.HtmlAttributes(new { style = "height: 700px;" })
.Scrollable()
.Groupable()
.Sortable()
.Filterable(ftb => ftb.Mode(GridFilterMode.Row))
.Pageable(pageable => pageable
.Refresh(true)
.PageSizes(pageSizes)
.ButtonCount(5))
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(30)
.Read(read => read.Action("Products_Read", "Home"))
)
)
</
div
>
I think my set up is ok but it's not working, the column Template is Empty plz help me. Thanks
columns.Template(item => "<
img
class
=
'product-photo'
src
=
'" + ImageModel.GetThumbnail(item.Images) + "'
alt
=
'" + item.Title + "'
/></
td
>")