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

Radgrid export additional data items

3 Answers 50 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Charles
Top achievements
Rank 1
Charles asked on 17 Feb 2009, 10:42 PM
How do i export additional data items not shown in radgrid but bound to the grid datasource? thanks

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 18 Feb 2009, 05:58 AM
Hello Charles,

I hope you are trying to export additional columns from the datasource of the grid. If so, you can hide the columns by setting its Visible property to false and setting the columns visibility to true on exporting(button click). To understand better, try out the code below:
aspx:
<telerik:GridBoundColumn Visible="false" ReadOnly="true" DataField="FirstName" HeaderText="FirstName" UniqueName="FirstName"></telerik:GridBoundColumn>      

cs:
 protected void ExportBtn_Click(object sender, EventArgs e) 
    { 
        RadGrid1.MasterTableView.GetColumnSafe("FirstName").Visible = true
        RadGrid1.ExportSettings.IgnorePaging = true
        RadGrid1.ExportSettings.ExportOnlyData = true
        RadGrid1.ExportSettings.OpenInNewWindow = true
 
        RadGrid1.MasterTableView.ExportToExcel(); 
    } 

Thanks
Princy. 
0
Charles
Top achievements
Rank 1
answered on 18 Feb 2009, 01:52 PM
Thanks Princy appreciate it. works great!
0
Shinu
Top achievements
Rank 2
answered on 19 Feb 2009, 04:03 AM
Hi Charles,

You can also refer the following help article which gives tips and tricks while exporting.
Exporting tips and tricks

Thanks
Shinu
Tags
Grid
Asked by
Charles
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Charles
Top achievements
Rank 1
Shinu
Top achievements
Rank 2
Share this question
or