Posted 25 January 2021, 4:09 am EST
Hello all,
I have a datagrid with custom column headers:
<DataTemplate x:Key="gridHeader">
<StackPanel>
<TextBlock ... />
<Separator ... />
<TextBlock ... />
<TextBlock ... />
</StackPanel>
</DataTemplate>
and in code behind:
DataTemplate dt = FindRessource("gridHeader") as DataTemplate;
StackPanel sp = dt.LoadContent() as StackPanel;
TextBlock tb = sp.Children[0] as TextBlock;
tb.Text = ...
Setting values for all TextBlocks works well.
Now I want to export the content of the grid as a “*.xlsx”-File.
The question is: how can I export my complex column headers properly - as text? At the moment cells remain empty in the exported file.