GrapeCity MultiRow Windows Forms Documentation
Border Property (CellStyle)
Example 


Gets or sets the Cell border.
Syntax
<SRCategoryAttribute("Appearance")>
<SRDescriptionAttribute("Indicates the border of the Cell.")>
<RefreshPropertiesAttribute(RefreshProperties.Repaint)>
Public Property Border As BorderBase
Dim instance As CellStyle
Dim value As BorderBase
 
instance.Border = value
 
value = instance.Border
[SRCategory("Appearance")]
[SRDescription("Indicates the border of the Cell.")]
[RefreshProperties(RefreshProperties.Repaint)]
public BorderBase Border {get; set;}

Property Value

A BorderBase value that represents the Cell border. The default is a null reference (Nothing in Visual Basic).
Remarks
The border can be an instance of Border, RoundedBorder, or ThreeDBorder.
Example
The following code example shows how to set the Cell's Border style and color. This example is part of a larger example available for the Border.
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

CellStyle Class
CellStyle Members

 

 


Copyright © GrapeCity, inc. All rights reserved.