0

I know how to define the style of the border for a Cell, like that for example:

Dim border As SpreadsheetGear.IBorder

border = sheet.Cells(1, column).Borders(SpreadsheetGear.BordersIndex.EdgeRight)

border.Color = System.Drawing.Color.Black
border.LineStyle = SpreadsheetGear.LineStyle.Continuous
border.Weight = SpreadsheetGear.BorderWeight.Medium

This is working.

What I want to do now is to define the style of the border for an entire column. Exactly like what I would obtain if in Excel I select the column by clicking on the header and define the border attributes.

I've tried to do it on this range:

border = sheet.Cells(1, column).Columns.Borders(SpreadsheetGear.BordersIndex.EdgeRight)

The code doen't crash, but it doesn't add a border.

Anybody can help ?

Samuel Rossille
  • 18,940
  • 18
  • 62
  • 90

1 Answers1

1

Instead of Columns, try EntireColumn:

border = sheet.Cells(1, column).EntireColumn.Borders(SpreadsheetGear.BordersIndex.EdgeRight)
Daniel
  • 5,602
  • 4
  • 33
  • 36