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

RadGrid export to CSV footer total problem

2 Answers 165 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Igor
Top achievements
Rank 1
Igor asked on 09 Nov 2010, 11:41 AM

Hi,

I have problem with export to csv footer total.In scv file not display footer total.
When I export the same data into pdf, i have no problem.


Thanks,
Igor

2 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 10 Nov 2010, 05:08 PM
Hello Igor,

We do not export the footer item since the CSV file does not support footers. You could add the desired row manually in the GridExporting event:
protected void RadGrid1_GridExporting(object sender, GridExportingArgs e)
{
    if (e.ExportType == ExportType.Csv)
    {
        string footer = "";
        GridFooterItem footerItem = RadGrid1.MasterTableView.GetItems(GridItemType.Footer)[0] as GridFooterItem;
        foreach (GridColumn column in RadGrid1.MasterTableView.RenderColumns)
            if (column.Visible)
                footer += String.Format("\"{0}\",", footerItem[column.UniqueName].Text.Replace(" ", ""));
        e.ExportOutput += footer.TrimEnd(',');
    }
}

Regards,
Daniel
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
suyash
Top achievements
Rank 1
answered on 17 May 2016, 11:14 AM
Hi Daniel , I just wanted to know that at which tab you pastes this code, It will be very kind of you if you attach a snapshot supporting your reply , thanks and regards.
Tags
Grid
Asked by
Igor
Top achievements
Rank 1
Answers by
Daniel
Telerik team
suyash
Top achievements
Rank 1
Share this question
or