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

Export radGrid to CSV with headers and maintain field types?

1 Answer 93 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ken
Top achievements
Rank 1
Ken asked on 18 Aug 2011, 04:03 AM
Right now I'm using the default export to CSV which maintains my field types when I open the file in excel, ie, currency stays as currency and percent as percent. What I want to do is export the grid with the headings it has also and still maintain type.

Is this possible with export to CSV?

1 Answer, 1 is accepted

Sort by
0
Jayesh Goyani
Top achievements
Rank 2
answered on 18 Aug 2011, 06:46 AM
Hello,

Please set below property and let me know its working or not?


protected void RadGrid1_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
        {
            if (e.CommandName == Telerik.Web.UI.RadGrid.ExportToExcelCommandName ||
                e.CommandName == Telerik.Web.UI.RadGrid.ExportToWordCommandName ||
                e.CommandName == Telerik.Web.UI.RadGrid.ExportToCsvCommandName)
            {
                RadGrid1.ExportSettings.ExportOnlyData = false;
            }
        }
     


Thanks,
Jayesh Goyani
Tags
Grid
Asked by
Ken
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
Share this question
or