To reproduce:
1. Add an image column and set wider columns than the images.
2. Group the grid(note that by default the image alignment is center).
3. Export using GridViewSpreadExport
4. The images in the exported file are not centered in the cells.
Note that the issue is not reproducible when there are not groups in the grid.
private void Renderer_WorkbookCreated(object sender, WorkbookCreatedEventArgs e)
{
if (this.gridView.GroupDescriptors.Count == 0)
{
return;
}
foreach (var imageShape in e.Workbook.ActiveWorksheet.Shapes)
{
double cellWidth = e.Workbook.ActiveWorksheet.Columns[imageShape.CellIndex.ColumnIndex].GetWidth().Value.Value;
double imageWidth = imageShape.Width;
imageShape.OffsetX = (cellWidth - imageWidth) / 2;
}
}