You're "recalculating" the grid height based on the "row count"; and you "toss" the grid's actual height. The result should be obvious. Pick a height to use as a "constant" if there are "zero" rows instead of "zero height".
int height = grdSpanSale.Height;
grdSpanSale.Height = grdSpanSale.RowCount * grdSpanSale.RowTemplate.Height;
bitmap = new Bitmap(this.grdSpanSale.Width, this.grdSpanSale.Height);