GrapeCity MultiRow Windows Forms Documentation
Top Property (Border)
Example 


Gets or sets the top line of the Border.
Syntax
<RefreshPropertiesAttribute(RefreshProperties.All)>
Public Property Top As Line
Dim instance As Border
Dim value As Line
 
instance.Top = value
 
value = instance.Top
[RefreshProperties(RefreshProperties.All)]
public Line Top {get; set;}

Property Value

A Line value for the top line of the Border.
Example
The following code example shows how to set the Top border style and color. This example is part of a larger example available for the Border class.
void setNormalBorderToCell_Click(object sender, EventArgs e)
        {
            Template template1 = gcMultiRow1.Template;

            Row row = template1.Row;

            Border normalBorder1 = new Border();

            //The outline borders have the LineStyle.Medium style and Red color.
            //normalBorder1.Outline = new Line(LineStyle.Medium, Color.Red);

            //Except the above, you can set each border in different style or color.
            normalBorder1.Top = new Line(LineStyle.SlantedDashDot, Color.Red);
            normalBorder1.Bottom = new Line(LineStyle.SlantedDashDot, Color.Orange);
            normalBorder1.Left = new Line(LineStyle.SlantedDashDot, Color.Blue);
            normalBorder1.Right = new Line(LineStyle.SlantedDashDot, Color.Green);

            row.Cells[0].Style.Border = normalBorder1;

            // Reload template1.
            this.gcMultiRow1.Template = template1;
        }
Private Sub setNormalBorderToCell_Click(ByVal sender As Object, ByVal e As EventArgs) Handles 
setNormalBorderToCell.Click
        Dim template1 As Template = gcMultiRow1.Template

        Dim row As Row = template1.Row

        Dim normalBorder1 As New Border()

        'The outline borders have the LineStyle.Medium style and Red color.
        'normalBorder1.Outline = new Line(LineStyle.Medium, Color.Red);

        'Except the above, you can set each border in different style or color.
        normalBorder1.Top = New Line(LineStyle.SlantedDashDot, Color.Red)
        normalBorder1.Bottom = New Line(LineStyle.SlantedDashDot, Color.Orange)
        normalBorder1.Left = New Line(LineStyle.SlantedDashDot, Color.Blue)
        normalBorder1.Right = New Line(LineStyle.SlantedDashDot, Color.Green)
        row.Cells(0).Style.Border = normalBorder1

        ' Reload template1.
        Me.gcMultiRow1.Template = template1
    End Sub
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

Border Class
Border Members
Outline Property
Bottom Property
Left Property
Right Property
DiagonalDown Property
DiagonalUp Property

 

 


Copyright © GrapeCity, inc. All rights reserved.