GrapeCity MultiRow Windows Forms Documentation
Borders

You can use four types of borders in cells. In the designer, you can use the context menu of the cell or click on the Cell.Style.Border property in the Properties window to display the Border dialog.

Default Borders

By default, the borders that are set on the cells are silver lines on all four sides of the cells. This setting has been inherited from the Template.Style.Border property.

Choose Default from the UI type editor for the border

Normal Borders

If you use the Border class, you can draw borders on all four sides of the cells. The borders can be set on either or all of the four sides, running from one corner to the other. You can also set color and style for each side.

Normal Border selected from Border UI Type editor

Using Code

This example sets the style border.

[VB]

Imports GrapeCity.Win.MultiRow

GcMultiRow1.Rows(0).Cells(0).Style.Border = New Border(LineStyle.Double, Color.Red)

[CS]

using GrapeCity.Win.MultiRow;

gcMultiRow1.Rows[0].Cells[0].Style.Border = new Border(LineStyle.Double, Color.Red);

3D Borders

You can draw borders with 3D effects if you use the ThreeDBorder class. The border is displayed on all four sides, enabling 3D display through usage of light and shadow.

 

Using Code

This example sets a 3D border.

[VB]

Imports GrapeCity.Win.MultiRow

GcMultiRow1.Rows(0).Cells(0).Style.Border = New ThreeDBorder(ThreeDEffect.Sunken)

[CS]

using GrapeCity.Win.MultiRow;

gcMultiRow1.Rows[0].Cells[0].Style.Border = new ThreeDBorder(ThreeDEffect.Sunken);

Rounded Borders

You can draw a rounded border if you use the RoundedBorder class. You can specify the border color and style for the four sides and four corners. You can also specify the angle of the rounded corner and whether anti-alias should be applied.

Rounded Border selected from the Border UI type editor

Using Code

This example creates a rounded border.

[VB]

Imports GrapeCity.Win.MultiRow

GcMultiRow1.Rows(0).Cells(0).Style.Border = New RoundedBorder(LineStyle.Double, Color.Red, 0.25F)

[CS]

using GrapeCity.Win.MultiRow;

gcMultiRow1.Rows[0].Cells[0].Style.Border = new RoundedBorder(LineStyle.Double, Color.Red, 0.25f);

Inheriting Borders

When no borders have been set, the style gets inherited from the one above. Refer to Rules for Applying Styles for details on the inheritance rules.

See Also

 

 


Copyright © GrapeCity, inc. All rights reserved.

Support Options