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

Export to Excel with wrapping headers.

2 Answers 142 Views
GridView
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 03 May 2011, 02:37 PM
Hi!

I have a Gridview, containing loads of columns. Some of the column headers are a bit wide, so therefore we use a Textblock in the header to wrap it and make it look a bit better.
Now I'm trying to export the data I have in the grid to Excel and it works great, until I look at the headers using the textblock where its instead of the actual header saying "System.Windows.Controls.TextBlock" now.

<telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn UniqueName="ProductCode" Width="150" DataMemberBinding="{Binding Task.ProductCode}" IsGroupable="False">
                    <telerik:GridViewDataColumn.Header>
                            <TextBlock Text="Delivery Item (Task Product-doc nr)"
                                       TextWrapping="Wrap"/>
                    </telerik:GridViewDataColumn.Header>
 
                </telerik:GridViewDataColumn>

Is there any way to do and export of the actual header instead? :)

2 Answers, 1 is accepted

Sort by
0
Accepted
Ivan Ivanov
Telerik team
answered on 03 May 2011, 04:44 PM
Hello John,

I have prepared an example project for your case. Please, refer to it and inform us if this approach meets your requirements.

Greetings,
Ivan Ivanov
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
John
Top achievements
Rank 1
answered on 04 May 2011, 07:30 AM
Great sample, and works perfectly! Thanks for all the help!
Tags
GridView
Asked by
John
Top achievements
Rank 1
Answers by
Ivan Ivanov
Telerik team
John
Top achievements
Rank 1
Share this question
or