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

Export RadGrid data to Excel

1 Answer 106 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jared
Top achievements
Rank 1
Jared asked on 17 Mar 2011, 04:35 AM
I'm having a problem exporting data from radgrid to excel format. As i export the data from the grid, the button is also attached inside the excel file which is not that way. The thing is that, I have to export the data from the radgrid to excel with its exact format (colors of grid, font style), but not including object like buttons. Kindly advice.

1 Answer, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 17 Mar 2011, 09:03 AM
Hello Jared,

You can set ExportOnlyData="true" to achieve this.
ASPX:
<telerik:RadGrid ID="RadGrid1"  runat="server" OnItemDataBound="RadGrid1_ItemDataBound">
    <ExportSettings ExportOnlyData="true">
    </ExportSettings>
    <MasterTableView >
         .   .   .   .   .
    </MasterTableView>
</telerik:RadGrid>

C#:
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
    {
        if (e.Item is GridDataItem)
           e.Item.Style["font-size"] = "x-large";
     }

Thanks,
Princy.
Tags
Grid
Asked by
Jared
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or