This example shows how to create templated columns for Telerik Grid for ASP.NET MVC. Templates allow you to customize the way the data is presented in the grid. Currently templates are supported only in server binding mode. Client-side templates will be implemented in a subsequent release. Also currently you cannot sort or filter by template column.
To set the template for a column you should use the Template method.
<% Html.Telerik().Grid(Model)
.Name("Grid")
.Columns(columns =>
{
//Template column. The grid displays the HTML defined by the argument.
columns.Template(c => {
%>
<img
alt="<%= c.CustomerID %>"
src="<%= Url.Content("~/Content/Grid/Customers/" + c.CustomerID + ".jpg") %>"
/>
<%
});
//Regular databound column. The grid displays the value of the CustomerID property.
columns.Bound(c => c.CustomerID);
})
.Render();
%>