Column header not exported properly for a data bound header

2 posts, 0 answers
  1. Madhu
    Madhu avatar
    30 posts
    Member since:
    May 2011

    Posted 03 Nov 2011 Link to this post

    Hi,

    I have a column in my gridview which needs to display the header dynamically based based on a condition. This is how it is defined
    <telerikGrid:GridViewDataColumn.Header>
                                            <TextBlock DataContext="{Binding ParentGridView.DataContext, ElementName=GridFinder}" Text="{Binding CoolantTempUnitName, TargetNullValue='Coolant Temp (F)', FallbackValue='Coolant Temp (F)'}" Foreground="White"/>
                                </telerikGrid:GridViewDataColumn.Header>

    But when I export data from this Grid, the header of this column is exported as System.Windows.Controls.StackPanel instead of the actual name. All the other column headers export correctly. Can you please provide a solution for this?

    Regards,
    Madhu
  2. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 03 Nov 2011 Link to this post

    Hello,

     You can catch ElementExporting for this column header and assign desired value to e.Value. You can check our demos for more info. 

    All the best,
    Vlad
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top