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

Export to CSV - ExportOnlyData="true"

2 Answers 147 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Richard
Top achievements
Rank 2
Richard asked on 10 Sep 2008, 08:47 PM
When I export data from grid to CSV and export setting is set to export data only (ExportOnlyData="true"), column "<telerik:GridEditCommandColumn" is exported too.

If I use ExportToExcel (or ExportToWord) instead of ExportToCSV, GridEditCommandColumn is not exported (ExportOnlyData="true").

Could you help me please?

     Richard

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 11 Sep 2008, 05:19 AM
Hi Richard,

One suggestion will be to hide the edit column in the Export button Click event and then export the Grid.

CS:
 protected void Button1_Click(object sender, EventArgs e) 
    { 
        RadGrid1.ExportSettings.ExportOnlyData=true
        RadGrid1.MasterTableView.GetColumn("ColumnUniqueName").Display = false
        RadGrid1.Rebind(); 
        RadGrid1.MasterTableView.ExportToCSV(); 
    } 


Thanks
Shinu.
0
Richard
Top achievements
Rank 2
answered on 11 Sep 2008, 07:55 AM
It helps me, but my EditCommandColumn is the last in the grid and when I hide it I get column delimiter (comma) on the end of each line:

"First Name","Last Name","Birthdate","Gender","Identifier",
"A","A","06/29/1982","male","60ad5e30-6b8f-4f00-ad0c-a0188c2b6206",
"B","B","05/14/1982","male","6696079d-dc37-4752-878b-c7fcb36183c3",

     Richard
Tags
Grid
Asked by
Richard
Top achievements
Rank 2
Answers by
Shinu
Top achievements
Rank 2
Richard
Top achievements
Rank 2
Share this question
or