Telerik Extensions for ASP.NET MVC

Version Q1 2012, released 04/19/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();
 %>

Get more than expected!

Take the Telerik Extensions for ASP.NET MVC to your Visual Studio projects to truly experience their power. Download your free copy now and jumpstart your development with the available learning resources.

The Extensions are offered in both open source and commercial versions the differences between which are well explained in the licensing FAQ.

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

Other Demos: