Telerik Extensions for ASP.NET MVC

Version Q2 2012, released 06/07/2012

Header & Footer Templates

Product IDProduct NameQuantity Per Unit
Units
Ordered In Stock
Unit Price
1Chai10 boxes x 20 bags
0 39
$18.00
2Chang24 - 12 oz bottles
40 17
$19.00
3Aniseed Syrup12 - 550 ml bottles
70 13
$10.00
4Chef Anton's Cajun Seasoning48 - 6 oz jars
0 53
$22.00
5Chef Anton's Gumbo Mix36 boxes
0 0
$21.35
6Grandma's Boysenberry Spread12 - 8 oz jars
0 120
$25.00
7Uncle Bob's Organic Dried Pears12 - 1 lb pkgs.
0 15
$30.00
8Northwoods Cranberry Sauce12 - 12 oz jars
0 6
$40.00
9Mishi Kobe Niku18 - 500 g pkgs.
0 29
$97.00
10Ikura12 - 200 ml jars
0 31
$31.00
Displaying items 1 - 10 of 77

About this example ASPXRazor

This example demonstrates how to use custom header and footer templates in Telerik Grid for ASP.NET MVC. The templates can be declared through the column's HeaderTemplate and FooterTemplate methods respectively.

To define a custom header and footer templates by using the following code

<%= Html.Telerik().Grid(Model)
        .Name("Grid")
        .Columns(columns =>
        {     
            columns.Bound(p => p.ProductID)
                   .HeaderTemplate(() =>
                      {%>
                      <input id="chkAll" type="checkbox" title="check all records"/>
                      <%});
            columns.Bound(p => p.UnitPrice)
                    .FooterTemplate(() =>
                        {%>
                        Total:<%= string.Format("{0:c}", Model.TotalPrice)%>
                        <%});
        }
        .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: