Posted 23 September 2022, 11:51 am EST - Updated 4 October 2022, 8:26 am EST
C1.WPF.DataGrid.Excel.4.5.2 4.5.20222.768
hello,
i have a c1datagrid with several text,numeric and date columns.
Each column is a custom column of c1- equivalent with overrided getColumText method for printing purpose.
Also a three row column header with multiple merged rows/cols.
Excel extention and advanced filter behavior are also active.
Problem:
If i save the datagrid over the extension method .Save(…)
only the default header is exported three times not the custom contet that i defined over the custom DateTime/Text/Numeric column GetColumnText() method.
Normally i expect that the datagrid.Save() method calls the GetColumnText() but it doesn’t do that.
to solve this problem is set the datagrid.DataGridHeadersVisibility to DataGridHeadersVisibility.All befor i call the datagrid.Save(…) method.
The GetColumnText() is called and the exported default header looks as expected.
After the datagrid.Save(…) method i set the datagrid.DataGridHeadersVisibility to DataGridHeadersVisibility.Row.
Question:
How do i get rid off the top three header rows for the export?
If if foreach through the top rows and set the DataGridColumnHeaderRow.Visibility = Visibility.Collapsed nothing happened. the top rows are still exported.
greetings from germany.