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

2 posts, 0 answers
  1. Tomasz
    Tomasz avatar
    1 posts
    Member since:
    May 2014

    Posted 13 Jul 2014 Link to this post

    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
     
  2. Yoan
    Admin
    Yoan avatar
    1214 posts

    Posted 14 Jul 2014 Link to this post

    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.
     
Back to Top