Telerik Extensions for ASP.NET MVC

Version Q2 2012, released 06/07/2012

Auto Generated Columns

NameAddressCountryCompanyPhoneBirthday 
Maria AndersObere Str. 57GermanyAlfreds Futterkiste030-00743216/19/2013Edit
Ana TrujilloAvda. de la Constitución 2222MexicoAna Trujillo Emparedados y helados(5) 555-47296/19/2013Edit
Antonio MorenoMataderos 2312MexicoAntonio Moreno Taquería(5) 555-39326/19/2013Edit
Thomas Hardy120 Hanover Sq.UKAround the Horn(171) 555-77886/19/2013Edit
Christina BerglundBerguvsvägen 8SwedenBerglunds snabbköp0921-12 34 656/19/2013Edit
Hanna MoosForsterstr. 57GermanyBlauer See Delikatessen0621-084606/19/2013Edit
Frédérique Citeaux24, place KléberFranceBlondel père et fils88.60.15.316/19/2013Edit
Martín SommerC/ Araquil, 67SpainBólido Comidas preparadas(91) 555 22 826/19/2013Edit
Laurence Lebihan12, rue des BouchersFranceBon app'91.24.45.406/19/2013Edit
Elizabeth Lincoln23 Tsawassen Blvd.CanadaBottom-Dollar Markets(604) 555-47296/19/2013Edit
Displaying items 1 - 10 of 91

About this example ASPXRazor

This example shows how Telerik Grid for ASP.NET MVC can infer its columns based on the properties of the data item it is bound to. A columns is created for every public property of simple type (integer, string, date, enum and boolean).

Column titles are inferred from the property name using pascal-case splitting - for example if the property name is CustomerID the inferred column title will be "Customer ID".

The following is an example of simple definition of the Grid:

<%= Html.Telerik().Grid(Model)
        .Name("Grid")
        .Sortable()
        .Scrollable()
        .Pageable()
 %>

The AutoGenerate method can be used to further customize the generated columns' settings:

<%= Html.Telerik().Grid(Model)
        .Name("Grid")
        .Columns(columns =>
                {   
                    columns.AutoGenerate(column =>
                        {                            
                            column.Width = "150px";
                            if (column.Member == "CustomerID")
                                column.Visible = false;
                        });                        
                })
 %>

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: