2

As we know, in Gembox Spreadsheet, you can set a border (with C# language) for a cell like:

worksheet.Cells[row, 2].Style.Borders.SetBorders(MultipleBorders.All, Color.FromArgb(252, 1, 1), LineStyle.Thin);

It is a way to check if a cell contains border (bottom or top border) ?

Update

I found the solution with Gembox support:

var hasLeftBorder = cell.Style.Borders[IndividualBorder.Left].LineStyle != LineStyle.None;
Snake Eyes
  • 16,287
  • 34
  • 113
  • 221
  • Check the `Gembox` API for equivalent to `.Borders(xlEdgeBottom).LineStyle = xlLineStyleNone` –  Sep 22 '14 at 08:11
  • I didn't found any trick related to what you wrote – Snake Eyes Sep 22 '14 at 08:44
  • I just wanted to add that if your `hasLeftBorder` is `true`, then the cell on its right side will have `IndividualBorder.Right `. However, if you want to find out which cell has that border directly defined on it, then you can use [`GetUnresolvedBorder`](https://www.gemboxsoftware.com/spreadsheet/help/html/M_GemBox_Spreadsheet_CellBorders_GetUnresolvedBorder.htm) method. – Mario Z Mar 28 '20 at 06:29

1 Answers1

0

Have a look on the Gembox Spreadsheet documentation page for the CellBorder class. There are 2 properties on the CellBorder class: LineColor & LineStyle - use the getter property of the LineStyle and compare it to a LineStyle enumeration