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

How-to Export gridview to Excel with properly named headers?

1 Answer 94 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Tomasz
Top achievements
Rank 1
Tomasz asked on 13 Jul 2014, 12:03 PM
Dear all,
I create an application using WPF (MVVM) along with Telerik UI for WPF. I got into a problem with exporting gridview to excel using GridView's export method.
Simply saying, all column headers that contain custom header show a type name instead of Header.Text:
<t:GridViewComboBoxColumn  Name="InterestAlgorithmColumn"
                                               
                                             ItemsSourceBinding="{Binding Source={StaticResource InterestAlgorithmsViewSource},UpdateSourceTrigger=PropertyChanged}"
                                             DataMemberBinding="{Binding InvestmentAlgorithmCode, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                                             DisplayMemberPath="AlgorithmName"
                                             SelectedValueMemberPath="AlgorithmCode"
                                             IsReadOnly="True">
                        <t:GridViewComboBoxColumn.Header>
                            <TextBlock Text="Algorithm Name" TextWrapping="Wrap"  Width="100"/>
                        </t:GridViewComboBoxColumn.Header>
                    </t:GridViewComboBoxColumn>

Is there a solution for this? Maybe there is another approach since I use custom .Header section because of Business wants to have the headers wrapped and setting Wrap in GridViewComboBoxColumn seems not working.

Regards
Tom
 

1 Answer, 1 is accepted

Sort by
0
Yoan
Telerik team
answered on 14 Jul 2014, 09:27 AM
Hi Tomasz,

I already answered your support ticket on the subject. For convenience I will paste my answer here as well:

I would suggest to check the Export Custom Header help article for a reference.


Regards,
Yoan
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
GridView
Asked by
Tomasz
Top achievements
Rank 1
Answers by
Yoan
Telerik team
Share this question
or