We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Missing RightBorder in merged cells

Hello,

I have an excel sheet with the following structure: a merged cell (A1:B1) and a normal cell C1. The borders for cell A1 are set to thin for all borders. If I access the style for this cell via GetDisplayStyle(), the RightBorder LineStyle is none.

Code: workbook.Worksheets[0].Cells[0,0].GetDisplayStyle().Borders[BorderType.RightBorder].LineStyle

If I access the last cell in the merged range with the following code, it has the correct border information.

workbook.Worksheets[0].Cells[0,0].GetMergedRange().GetCellOrNull(0,workbook.Worksheets[0].Cells[0,0].GetMergedRange().ColumnCount-1).GetDisplayStyle().Borders[BorderType.RightBorder].LineStyle

Is this behavior intended?

Thanks!
Mel

Hi,

Thanks for your questions and considering Aspose.Cells.

I look into it and set the border of one of the any two cells in Ms-Excel, I set the first cell’s right border and then watched the borders of the cell right to previous cell, its’ left border was set.

It means, borders are shared. For example, if you set the right border of cell B1, then the left border of cell C1 will also be set.