I add to grid GridImageColumn, and replace data from model to image. This is ok, but when I have export grid to excel I have error
System.ArgumentNullException Buffer cannot be null. parameter name: buffer
private void sfDataGrid_QueryImageCellStyle(object sender, QueryImageCellStyleEventArgs e)
{
if (e.Column.MappingName == "HasMR" || e.Column.MappingName == "HasRC")
{
if (e.DisplayText == "1")
{
e.Image = Properties.Resources.check_tmp;
e.ImageLayout = ImageLayout.Zoom;
}
else
{
e.Image = null;
}
e.DisplayText = string.Empty;
}
}
public void ExportExcel()
{
var options = new ExcelExportingOptions();
options.AllowOutlining = true;
options.ExcelVersion = ExcelVersion.Excel2016;
var excelEngine = sfDataGrid.ExportToExcel(sfDataGrid.View, options); <-error
}