Class CellBordersInfo
Provides a StyleInfoSubObjectBase object for borders in a cell. Each border side of the cell can be configured individually with a System.Windows.Media.Pen value. Border sides that have not been initialized will inherit default values from a base style.
Implements
Inherited Members
Namespace: Syncfusion.Windows.Controls.Cells
Assembly: Syncfusion.GridCommon.WPF.dll
Syntax
public class CellBordersInfo : StyleInfoSubObjectBase, IDisposable, IStyleInfo, ISupportInitialize, IFormattable, IConvertible, IXmlSerializable, IStyleInfoSubObject
Examples
The following code changes border information for cells:
Pen border = new Pen(Brushes.DarkGray, 1);
model[rowIndex, colIndex].Borders.Bottom = border;
model[rowIndex, colIndex].Borders.Right = border;
The following code hides grid lines for specific cells:
Pen border = new Pen(Brushes.Black, 0);
model[rowIndex, colIndex].Borders.Bottom = border;
model[rowIndex, colIndex].Borders.Right = border;
Constructors
CellBordersInfo()
Initializes a new empty CellBordersInfo object.
Declaration
public CellBordersInfo()
CellBordersInfo(StyleInfoSubObjectIdentity)
Initalizes a new CellBordersInfo object and associates it with an existing StyleInfoSubObjectIdentity.
Declaration
public CellBordersInfo(StyleInfoSubObjectIdentity identity)
Parameters
| Type | Name | Description |
|---|---|---|
| StyleInfoSubObjectIdentity | identity | A CachedStyleInfoSubObjectIdentity that holds the indentity for this CellBordersInfo. |
CellBordersInfo(StyleInfoSubObjectIdentity, CellBordersInfoStore)
Initalizes a new CellBordersInfo object and associates it with an existing StyleInfoSubObjectIdentity.
Declaration
public CellBordersInfo(StyleInfoSubObjectIdentity identity, CellBordersInfoStore store)
Parameters
| Type | Name | Description |
|---|---|---|
| StyleInfoSubObjectIdentity | identity | A StyleInfoSubObjectIdentity that holds the indentity for this CellBordersInfo. A CellBordersInfoStore that holds data for this CellBordersInfo. All changes in this style object will saved in the CellBordersInfoStore object. |
| CellBordersInfoStore | store |
Properties
All
Allows you to set all four border sides with one command.
Declaration
public Pen All { set; }
Property Value
| Type |
|---|
| System.Windows.Media.Pen |
Examples
model[2, 2].Borders.All = new Pen(Brushes.DarkGray, 1);
Bottom
The bottom border
Declaration
public Pen Bottom { get; set; }
Property Value
| Type |
|---|
| System.Windows.Media.Pen |
Default
Returns a default CellBordersInfo to be used with a default style.
Declaration
public static CellBordersInfo Default { get; }
Property Value
| Type |
|---|
| CellBordersInfo |
HasBottom
Determines if the bottom border has been initialized.
Declaration
public bool HasBottom { get; }
Property Value
| Type |
|---|
| System.Boolean |
HasLeft
Determines if the left border has been initialized.
Declaration
public bool HasLeft { get; }
Property Value
| Type |
|---|
| System.Boolean |
HasRight
Determines if the right border has been initialized.
Declaration
public bool HasRight { get; }
Property Value
| Type |
|---|
| System.Boolean |
HasTop
Determines if the top border has been initialized.
Declaration
public bool HasTop { get; }
Property Value
| Type |
|---|
| System.Boolean |
Item[CellBorderSide]
Returns the System.Windows.Media.Pen for the specified CellBorderSide
Declaration
public Pen this[CellBorderSide side] { get; set; }
Parameters
| Type | Name | Description |
|---|---|---|
| CellBorderSide | side |
Property Value
| Type |
|---|
| System.Windows.Media.Pen |
Left
The left border
Declaration
public Pen Left { get; set; }
Property Value
| Type |
|---|
| System.Windows.Media.Pen |
Right
The right border
Declaration
public Pen Right { get; set; }
Property Value
| Type |
|---|
| System.Windows.Media.Pen |
Top
The top border
Declaration
public Pen Top { get; set; }
Property Value
| Type |
|---|
| System.Windows.Media.Pen |
Methods
CreateObject(StyleInfoSubObjectIdentity, Object)
Creates the CellBordersInfo object.
Declaration
public static object CreateObject(StyleInfoSubObjectIdentity identity, object store)
Parameters
| Type | Name | Description |
|---|---|---|
| StyleInfoSubObjectIdentity | identity | The identity. |
| System.Object | store | The store. |
Returns
| Type |
|---|
| System.Object |
Dispose()
Declaration
public override void Dispose()
Overrides
GetDefaultStyle()
Returns Default
Declaration
protected override StyleInfoBase GetDefaultStyle()
Returns
| Type | Description |
|---|---|
| StyleInfoBase | A CellBordersInfo object with default values. |
Overrides
MakeCopy(StyleInfoBase, StyleInfoProperty)
Declaration
public override IStyleInfoSubObject MakeCopy(StyleInfoBase newOwner, StyleInfoProperty sip)
Parameters
| Type | Name | Description |
|---|---|---|
| StyleInfoBase | newOwner | |
| StyleInfoProperty | sip |
Returns
| Type |
|---|
| IStyleInfoSubObject |
Overrides
ResetAll()
Resets all four border sides with one command.
Declaration
public void ResetAll()
ResetBottom()
Resets the bottom border
Declaration
public void ResetBottom()
ResetLeft()
Resets the left border
Declaration
public void ResetLeft()
ResetRight()
Resets the right border
Declaration
public void ResetRight()
ResetTop()
Resets the top border
Declaration
public void ResetTop()