Reputation: 19848
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 ?
Upvotes: 0
Views: 3756
Reputation: 5732
Instead of Columns, try EntireColumn:
border = sheet.Cells(1, column).EntireColumn.Borders(SpreadsheetGear.BordersIndex.EdgeRight)
Upvotes: 1