Background:
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;
}
Tags:
Ruchir Agarwal