SetBorders

Set the borders of cells.

Overloads

Overload Name Description
All Set border top, left, bottom, right, inside vertical, and inside horizontal.
Color Set border color.
Diagonal
(Deprecated in: 8.0.0)
Set diagonal-up and diagonal-down border.


Diagonal borders will not render in Dodeca. Diagonal borders created in Dodeca will render in Excel.

LineStyle Set border line style. The SpreadsheetGear control can only render the Excel line styles None, Continuous, and Double. The Excel line styles Dash, DashDot, DashDotDot, Dot, and SlantDashDot are rendered as Continuous. All Excel line styles are maintained and displayed correctly when the workbook is viewed in Excel. The SpreadsheetGear line styles are supported by the LineStyleSG overload.
LineStyleSG (8.0) Set the border line style to a style available in the SpreadsheetGear control, which cannot render the Excel line styles Dash, DashDot, DashDotDot, Dot, and SlantDashDot. When using the LineStyle overload, these Excel styles are rendered as the Excel line style Continuous. The LineStyleSG overload provides the line styles None, Dotted, Thin, Medium, Thick, and Double, which render correctly in the SpreadsheetGear control and will look the same when the workbook is viewed in Excel.
None Remove borders.
Weight Set border weight.


All

Set border top, left, bottom, right, inside vertical, and inside horizontal.

Argument Description
SpecifySheetBy Select how to specify which worksheet to select while the method is being executed.
Specify one of the following values or an arbitrary value: <blank>SheetNameSheetNumberAllSheets
SheetSpec Specify the sheet-name or sheet-number, depending on SpecifySheetBy. If SpecifySheetBy is AllSheets then SheetSpec can be left empty.
Address The address of a range to select for the execution of the method.
CellByCell Whether to execute the method on a cell-by-cell basis, or on the range specified by the address.
ReverseOrder Whether to loop through the rows and columns from highest to lowest. Only applies when CellByCell is true.
MethodCondition If the result of method-condition expression resolves to FALSE, then the method is not executed.
Specify one of the following values or an arbitrary value: <blank>FALSETRUE
CellCondition If the result of the condition expression resolves to FALSE, then the current cell is skipped.
Specify one of the following values or an arbitrary value: <blank>FALSETRUE
ColorRGB (8.0) Select a color to use for the border color. ColorRGB is used if Color and ColorRGB are both specified.
Color Excel color palette index to use for the border color. The value is zero-based from 0 to 55.
Specify one of the following values or an arbitrary value: <blank>012345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
LineStyle
Excel LineStyle to use for border. The SpreadsheetGear control can only render the Excel line styles None, Continuous, and Double. The Excel line styles Dash, DashDot, DashDotDot, Dot, and SlantDashDot are rendered as Continuous. All Excel line styles are maintained and displayed correctly when the workbook is viewed in Excel. The SpreadsheetGear line styles are supported by the LineStyleSG argument.
If LineStyle and LineStyleSG are both specified, then LineStyleSG will be used.
Specify one of the following values or an arbitrary value: <blank>ContinuousDashDashDotDashDotDotDotDoubleLineStyleNoneSlantDashDot
LineStyleSG (8.0) SpreadsheetGear LineStyle to use for border. Options include the line styles that can be rendered by the SpreadsheetGear control.
If LineStyle and LineStyleSG are both specified, then LineStyleSG will be used.
Specify one of the following values or an arbitrary value: <blank>NoneDottedThinMediumThickDouble
Weight WeightNumber to use for border.
Specify one of the following values or an arbitrary value: <blank>HairlineMediumThickThin

Color

Set border color.

Argument Description
SpecifySheetBy Select how to specify which worksheet to select while the method is being executed.
Specify one of the following values or an arbitrary value: <blank>SheetNameSheetNumberAllSheets
SheetSpec Specify the sheet-name or sheet-number, depending on SpecifySheetBy. If SpecifySheetBy is AllSheets then SheetSpec can be left empty.
Address The address of a range to select for the execution of the method.
CellByCell Whether to execute the method on a cell-by-cell basis, or on the range specified by the address.
ReverseOrder Whether to loop through the rows and columns from highest to lowest. Only applies when CellByCell is true.
MethodCondition If the result of method-condition expression resolves to FALSE, then the method is not executed.
Specify one of the following values or an arbitrary value: <blank>FALSETRUE
CellCondition If the result of the condition expression resolves to FALSE, then the current cell is skipped.
Specify one of the following values or an arbitrary value: <blank>FALSETRUE
TopColorRGB (8.0) Select a color to use for the top border color. TopColorRGB is used if TopColor and TopColorRGB are both specified.
BottomColorRGB (8.0) Select a color to use for bottom the border color. BottomColorRGB is used if BottomColor and BottomColorRGB are both specified.
LeftColorRGB (8.0) Select a color to use for the left border color. LeftColorRGB is used if LeftColor and LeftColorRGB are both specified.
RightColorRGB (8.0) Select a color to use for the right border color. RightColorRGB is used if RightColor and RightColorRGB are both specified.
OutsideColorRGB (8.0) Select a color to use for the outside border color. OutsideColorRGB is used if OutsideColor and OutsideColorRGB are both specified.
InsideColorRGB (8.0) Select a color to use for the inside border color. InsideColorRGB is used if InsideColor and InsideColorRGB are both specified.
InsideVerticalColorRGB (8.0) Select a color to use for the inside vertical border color. InsideVerticalColorRGB is used if InsideVerticalColor and InsideVerticalColorRGB are both specified.
InsideHorizontalColorRGB (8.0) Select a color to use for the inside horizontal border color. InsideHorizontalColorRGB is used if InsideHorizontalColor and InsideHorizontalColorRGB are both specified.
TopColor Excel color palette index to use for top border color. The value is zero-based from 0 to 55.
Specify one of the following values or an arbitrary value: <blank>012345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
BottomColor Excel color palette index to use for bottom border color. The value is zero-based from 0 to 55.
Specify one of the following values or an arbitrary value: <blank>012345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
LeftColor Excel color palette index to use for left border color. The value is zero-based from 0 to 55.
Specify one of the following values or an arbitrary value: <blank>012345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
RightColor Excel color palette index to use for right border color. The value is zero-based from 0 to 55.
Specify one of the following values or an arbitrary value: <blank>012345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
OutsideColor Excel color palette index to use for outside border color. The value is zero-based from 0 to 55.
Specify one of the following values or an arbitrary value: <blank>012345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
InsideColor Excel color palette index to use for inside border color. The value is zero-based from 0 to 55.
Specify one of the following values or an arbitrary value: <blank>012345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
InsideVerticalColor Excel color palette index to use for inside-vertical border color. The value is zero-based from 0 to 55.
Specify one of the following values or an arbitrary value: <blank>012345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
InsideHorizontalColor Excel color palette index to use for inside-horizontal border color. The value is zero-based from 0 to 55.
Specify one of the following values or an arbitrary value: <blank>012345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455

Diagonal
(Deprecated in: 8.0.0)

Set diagonal-up and diagonal-down border.


Diagonal borders will not render in Dodeca. Diagonal borders created in Dodeca will render in Excel.

Argument Description
SpecifySheetBy Select how to specify which worksheet to select while the method is being executed.
Specify one of the following values or an arbitrary value: <blank>SheetNameSheetNumberAllSheets
SheetSpec Specify the sheet-name or sheet-number, depending on SpecifySheetBy. If SpecifySheetBy is AllSheets then SheetSpec can be left empty.
Address The address of a range to select for the execution of the method.
CellByCell Whether to execute the method on a cell-by-cell basis, or on the range specified by the address.
ReverseOrder Whether to loop through the rows and columns from highest to lowest. Only applies when CellByCell is true.
MethodCondition If the result of method-condition expression resolves to FALSE, then the method is not executed.
Specify one of the following values or an arbitrary value: <blank>FALSETRUE
CellCondition If the result of the condition expression resolves to FALSE, then the current cell is skipped.
Specify one of the following values or an arbitrary value: <blank>FALSETRUE
DiagonalDownColor (8.0) Excel color palette index to use for right-diagonal border color. The value is zero-based from 0 to 55.
Specify one of the following values or an arbitrary value: <blank>012345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
DiagonalDownColorRGB (8.0) Select a color to use for the diagonal down border color. DiagonalDownColorRGB is used if DiagonalDownColor and DiagonalDownColorRGB are both specified.
DiagonalDownStyle (8.0) Excel LineStyle to use for right-diagonal border.
Specify one of the following values or an arbitrary value: <blank>ContinuousDashDashDotDashDotDotDotDoubleLineStyleNoneSlantDashDot
DiagonalDownWeight (8.0) WeightNumber to use for right-diagonal border.
Specify one of the following values or an arbitrary value: <blank>HairlineMediumThickThin
DiagonalUpColor (8.0) Excel color palette index to use for left-diagonal border color. The value is zero-based from 0 to 55.
Specify one of the following values or an arbitrary value: <blank>012345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
DiagonalUpColorRGB (8.0) Select a color to use for the diagonal up border color. DiagonalUpColorRGB is used if DiagonalUpColor and DiagonalUpColorRGB are both specified.
DiagonalUpStyle (8.0) Excel LineStyle to use for left-diagonal border.
Specify one of the following values or an arbitrary value: <blank>ContinuousDashDashDotDashDotDotDotDoubleLineStyleNoneSlantDashDot
DiagonalUpWeight (8.0) WeightNumber to use for left-diagonal border.
Specify one of the following values or an arbitrary value: <blank>HairlineMediumThickThin

LineStyle

Set border line style. The SpreadsheetGear control can only render the Excel line styles None, Continuous, and Double. The Excel line styles Dash, DashDot, DashDotDot, Dot, and SlantDashDot are rendered as Continuous. All Excel line styles are maintained and displayed correctly when the workbook is viewed in Excel. The SpreadsheetGear line styles are supported by the LineStyleSG overload.

Argument Description
SpecifySheetBy Select how to specify which worksheet to select while the method is being executed.
Specify one of the following values or an arbitrary value: <blank>SheetNameSheetNumberAllSheets
SheetSpec Specify the sheet-name or sheet-number, depending on SpecifySheetBy. If SpecifySheetBy is AllSheets then SheetSpec can be left empty.
Address The address of a range to select for the execution of the method.
CellByCell Whether to execute the method on a cell-by-cell basis, or on the range specified by the address.
ReverseOrder Whether to loop through the rows and columns from highest to lowest. Only applies when CellByCell is true.
MethodCondition If the result of method-condition expression resolves to FALSE, then the method is not executed.
Specify one of the following values or an arbitrary value: <blank>FALSETRUE
CellCondition If the result of the condition expression resolves to FALSE, then the current cell is skipped.
Specify one of the following values or an arbitrary value: <blank>FALSETRUE
TopStyle Excel LineStyle to use for top border.
Specify one of the following values or an arbitrary value: <blank>ContinuousDashDashDotDashDotDotDotDoubleLineStyleNoneSlantDashDot
BottomStyle Excel LineStyle to use for bottom border.
Specify one of the following values or an arbitrary value: <blank>ContinuousDashDashDotDashDotDotDotDoubleLineStyleNoneSlantDashDot
LeftStyle Excel LineStyle to use for left border.
Specify one of the following values or an arbitrary value: <blank>ContinuousDashDashDotDashDotDotDotDoubleLineStyleNoneSlantDashDot
RightStyle Excel LineStyle to use for right border.
Specify one of the following values or an arbitrary value: <blank>ContinuousDashDashDotDashDotDotDotDoubleLineStyleNoneSlantDashDot
OutsideStyle Excel LineStyle to use for outside border.
Specify one of the following values or an arbitrary value: <blank>ContinuousDashDashDotDashDotDotDotDoubleLineStyleNoneSlantDashDot
InsideStyle Excel LineStyle to use for inside border.
Specify one of the following values or an arbitrary value: <blank>ContinuousDashDashDotDashDotDotDotDoubleLineStyleNoneSlantDashDot
InsideVerticalStyle Excel LineStyle to use for inside-vertical border.
Specify one of the following values or an arbitrary value: <blank>ContinuousDashDashDotDashDotDotDotDoubleLineStyleNoneSlantDashDot
InsideHorizontalStyle Excel LineStyle to use for inside-horizontal border.
Specify one of the following values or an arbitrary value: <blank>ContinuousDashDashDotDashDotDotDotDoubleLineStyleNoneSlantDashDot

LineStyleSG (8.0)

Set the border line style to a style available in the SpreadsheetGear control, which cannot render the Excel line styles Dash, DashDot, DashDotDot, Dot, and SlantDashDot. When using the LineStyle overload, these Excel styles are rendered as the Excel line style Continuous. The LineStyleSG overload provides the line styles None, Dotted, Thin, Medium, Thick, and Double, which render correctly in the SpreadsheetGear control and will look the same when the workbook is viewed in Excel.

Argument Description
SpecifySheetBy Select how to specify which worksheet to select while the method is being executed.
Specify one of the following values or an arbitrary value: <blank>SheetNameSheetNumberAllSheets
SheetSpec Specify the sheet-name or sheet-number, depending on SpecifySheetBy. If SpecifySheetBy is AllSheets then SheetSpec can be left empty.
Address The address of a range to select for the execution of the method.
CellByCell Whether to execute the method on a cell-by-cell basis, or on the range specified by the address.
ReverseOrder Whether to loop through the rows and columns from highest to lowest. Only applies when CellByCell is true.
MethodCondition If the result of method-condition expression resolves to FALSE, then the method is not executed.
Specify one of the following values or an arbitrary value: <blank>FALSETRUE
CellCondition If the result of the condition expression resolves to FALSE, then the current cell is skipped.
Specify one of the following values or an arbitrary value: <blank>FALSETRUE
Top SpreadsheetGear LineStyle to use for the top border.
Specify one of the following values or an arbitrary value: <blank>NoneDottedThinMediumThickDouble
Bottom SpreadsheetGear LineStyle to use for the bottom border.
Specify one of the following values or an arbitrary value: <blank>NoneDottedThinMediumThickDouble
Left SpreadsheetGear LineStyle to use for the left border.
Specify one of the following values or an arbitrary value: <blank>NoneDottedThinMediumThickDouble
Right SpreadsheetGear LineStyle to use for the right border.
Specify one of the following values or an arbitrary value: <blank>NoneDottedThinMediumThickDouble
Outside SpreadsheetGear LineStyle to use for the outside border.
Specify one of the following values or an arbitrary value: <blank>NoneDottedThinMediumThickDouble
Inside SpreadsheetGear LineStyle to use for the inside border.
Specify one of the following values or an arbitrary value: <blank>NoneDottedThinMediumThickDouble
InsideVertical SpreadsheetGear LineStyle to use for the inside-vertical border.
Specify one of the following values or an arbitrary value: <blank>NoneDottedThinMediumThickDouble
InsideHorizontal SpreadsheetGear LineStyle to use for the inside-horizontal border.
Specify one of the following values or an arbitrary value: <blank>NoneDottedThinMediumThickDouble

None

Remove borders.

Argument Description
SpecifySheetBy Select how to specify which worksheet to select while the method is being executed.
Specify one of the following values or an arbitrary value: <blank>SheetNameSheetNumberAllSheets
SheetSpec Specify the sheet-name or sheet-number, depending on SpecifySheetBy. If SpecifySheetBy is AllSheets then SheetSpec can be left empty.
Address The address of a range to select for the execution of the method.
CellByCell Whether to execute the method on a cell-by-cell basis, or on the range specified by the address.
ReverseOrder Whether to loop through the rows and columns from highest to lowest. Only applies when CellByCell is true.
MethodCondition If the result of method-condition expression resolves to FALSE, then the method is not executed.
Specify one of the following values or an arbitrary value: <blank>FALSETRUE
CellCondition If the result of the condition expression resolves to FALSE, then the current cell is skipped.
Specify one of the following values or an arbitrary value: <blank>FALSETRUE

Weight

Set border weight.

Argument Description
SpecifySheetBy Select how to specify which worksheet to select while the method is being executed.
Specify one of the following values or an arbitrary value: <blank>SheetNameSheetNumberAllSheets
SheetSpec Specify the sheet-name or sheet-number, depending on SpecifySheetBy. If SpecifySheetBy is AllSheets then SheetSpec can be left empty.
Address The address of a range to select for the execution of the method.
CellByCell Whether to execute the method on a cell-by-cell basis, or on the range specified by the address.
ReverseOrder Whether to loop through the rows and columns from highest to lowest. Only applies when CellByCell is true.
MethodCondition If the result of method-condition expression resolves to FALSE, then the method is not executed.
Specify one of the following values or an arbitrary value: <blank>FALSETRUE
CellCondition If the result of the condition expression resolves to FALSE, then the current cell is skipped.
Specify one of the following values or an arbitrary value: <blank>FALSETRUE
TopWeight WeightNumber to use for top border.
Specify one of the following values or an arbitrary value: <blank>HairlineMediumThickThin
BottomWeight WeightNumber to use for bottom border.
Specify one of the following values or an arbitrary value: <blank>HairlineMediumThickThin
LeftWeight WeightNumber to use for left border.
Specify one of the following values or an arbitrary value: <blank>HairlineMediumThickThin
RightWeight WeightNumber to use for right border.
Specify one of the following values or an arbitrary value: <blank>HairlineMediumThickThin
OutsideWeight WeightNumber to use for outside border.
Specify one of the following values or an arbitrary value: <blank>HairlineMediumThickThin
InsideWeight WeightNumber to use for inside border.
Specify one of the following values or an arbitrary value: <blank>HairlineMediumThickThin
InsideVerticalWeight WeightNumber to use for inside-vertical border.
Specify one of the following values or an arbitrary value: <blank>HairlineMediumThickThin
InsideHorizontalWeight WeightNumber to use for inside-horizontal border.
Specify one of the following values or an arbitrary value: <blank>HairlineMediumThickThin