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

Column header not exported properly for a data bound header

1 Answer 49 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Madhu
Top achievements
Rank 1
Madhu asked on 03 Nov 2011, 09:01 AM
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

1 Answer, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 03 Nov 2011, 09:16 AM
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 >>

Tags
GridView
Asked by
Madhu
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Share this question
or