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

Order of columns when exporting to Excel

3 Answers 320 Views
GridView
This is a migrated thread and some comments may be shown as answers.
bkagan98
Top achievements
Rank 1
bkagan98 asked on 03 Jun 2011, 02:57 AM
How can I change the order of columns when I export RadGridView data into Excel? Please advise. Thanks.

3 Answers, 1 is accepted

Sort by
0
Vanya Pavlova
Telerik team
answered on 03 Jun 2011, 07:42 AM
Hi Boris,

 
You may use the DisplayIndex property of a column to achieve your goal. 

Kind regards,
Vanya Pavlova
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
bkagan98
Top achievements
Rank 1
answered on 03 Jun 2011, 02:00 PM
Hi Vanya,

The DisplayIndex property will change the order of columns in the GridView itself. I am looking for some command on changing the columns order in export stream, but not in the Grid itself.

Thanks.
0
Vanya Pavlova
Telerik team
answered on 05 Jun 2011, 06:54 PM
Hi Boris,

 

There is no such built in command that will allow you to change the order of a column in such way. 
You may use the Element_Exported event of RadGridView to write directly to the stream. There you may change the order of the columns using the DisplayIndex property of a column. 


Greetings,
Vanya Pavlova
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
Tags
GridView
Asked by
bkagan98
Top achievements
Rank 1
Answers by
Vanya Pavlova
Telerik team
bkagan98
Top achievements
Rank 1
Share this question
or