This is a migrated thread and some comments may be shown as answers.

How to export to CSV only a few columns of a radgrid

1 Answer 235 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Lourival de Souza Junior
Top achievements
Rank 1
Lourival de Souza Junior asked on 24 Jan 2011, 04:05 PM
Hi, i'm trying to export only a few columns of a  bounded Radgrid in my asp.net page to a .CSV. How to determine/select the columns that will be exported by their names? The code to select the columns need to be in GridExporting? Thanks.

1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 24 Jan 2011, 09:24 PM
Hello Lourival de Souza Junior,

You can hide the desired columns in the click handler of the export button.
protected void Button1_Click(object sender, EventArgs e)
{
   RadGrid1.MasterTableView.GetColumn("Column1").Visible = false;
   RadGrid1.MasterTableView.GetColumn("Column2").Visible = false;
   RadGrid1.MasterTableView.ExportToCSV();
}

CSV export

Regards,
Daniel
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
Grid
Asked by
Lourival de Souza Junior
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or