Telerik Extensions for ASP.NET MVC

Version Q1 2012, released 04/19/2012

Toolbar Command (CSV Export)

Order ID
Filter
Contact Name
Filter
Ship Address
Filter
Order Date
Filter
10248Paul Henriot59 rue de l'Abbaye07/04/1996
10249Karin JosephsLuisenstr. 4807/05/1996
10250Mario PontesRua do Paço, 6707/08/1996
10251Mary Saveley2, rue du Commerce07/08/1996
10252Pascale CartrainBoulevard Tirou, 25507/09/1996
10253Mario PontesRua do Paço, 6707/10/1996
10254Yang WangHauptstr. 3107/11/1996
10255Michael HolzStarenweg 507/12/1996
10256Paula ParenteRua do Mercado, 1207/15/1996
10257Carlos HernándezCarrera 22 con Ave. Carlos Soublette #8-3507/16/1996
Displaying items 1 - 10 of 830

About this example ASPXRazor

This example shows how to use a custom toolbar command in Telerik Grid for ASP.NET MVC. Custom commands can be configured to call action methods. In this particular example the custom command is exporting the grid data to CSV (comma separated values) format which can be easily open with Microsoft Excel. If you want, you can export to XLS format (binary Excel), too.

To define a custom command use the following code

<%= Html.Telerik().Grid(Model)
        .Name("Grid")
        .ToolBar(commands => commands
           .Custom() .Text("Export to CSV") .Action("Action", "Controller")
        )
%>

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: