Telerik Extensions for ASP.NET MVC

Version Q1 2012, released 04/19/2012

Auto Generated Columns

NameAddressCountryCompanyPhoneBirthday 
Maria AndersObere Str. 57GermanyAlfreds Futterkiste030-00743215/22/2012Edit
Ana TrujilloAvda. de la Constitución 2222MexicoAna Trujillo Emparedados y helados(5) 555-47295/22/2012Edit
Antonio MorenoMataderos 2312MexicoAntonio Moreno Taquería(5) 555-39325/22/2012Edit
Thomas Hardy120 Hanover Sq.UKAround the Horn(171) 555-77885/22/2012Edit
Christina BerglundBerguvsvägen 8SwedenBerglunds snabbköp0921-12 34 655/22/2012Edit
Hanna MoosForsterstr. 57GermanyBlauer See Delikatessen0621-084605/22/2012Edit
Frédérique Citeaux24, place KléberFranceBlondel père et fils88.60.15.315/22/2012Edit
Martín SommerC/ Araquil, 67SpainBólido Comidas preparadas(91) 555 22 825/22/2012Edit
Laurence Lebihan12, rue des BouchersFranceBon app'91.24.45.405/22/2012Edit
Elizabeth Lincoln23 Tsawassen Blvd.CanadaBottom-Dollar Markets(604) 555-47295/22/2012Edit
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;
                        });                        
                })
 %>

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: