Can't find what you're looking for?

Contact us or post in our forums and we'll help you find an answer.

Export DataTemplate Column to Excel in C1DataGrid for WPF Edition | ComponentOne


While exporting C1DataGrid to Excel, data present in DataTemplateColumn is not exported by default.

Steps to Complete:

To save the data present in DataTemplate column, use GettingCellValue event of DataTemplate column:

private void DataGridTemplateColumn_GettingCellValue(object sender, C1.WPF.DataGrid.DataGridGettingCellValueEventArgs e)
      e.Value = ((TextBlock)(e.Row.Presenter[grid.Columns["TemplateCol"]].Content)).Text;

Get the Latest Version of WPF Edition
Download the Free Trial Now