Telerik Extensions for ASP.NET MVC

Version Q2 2012, released 06/07/2012

Server Templates

PictureNamePhone
ALFKIMaria Anders030-0074321
ANATRAna Trujillo(5) 555-4729
ANTONAntonio Moreno(5) 555-3932
AROUTThomas Hardy(171) 555-7788
BERGSChristina Berglund0921-12 34 65
BLAUSHanna Moos0621-08460
BLONPFrédérique Citeaux88.60.15.31
BOLIDMartín Sommer(91) 555 22 82
BONAPLaurence Lebihan91.24.45.40
BOTTMElizabeth Lincoln(604) 555-4729
Displaying items 1 - 10 of 91

About this example ASPXRazor

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();
 %>

Interested in HTML5 and mobile-powered ASP.NET MVC apps?

Experience the next generation UI and framework for ASP.NET MVC development by downloading trial evaluation copy of Kendo UI Complete for ASP.NET MVC. Jumpstart your development with the available learning resources.

The differences between Telerik MVC Extensions and Kendo UI Complete for ASP.NET MVC, and their licensing models are explained here and here.

If you have any questions, do not hesitate to contact us at sales@telerik.com.

Other Demos: