Class GridBorder
Represents the immutable class that holds formatting information for individual borders of a cell.
Inheritance
Implements
Inherited Members
Namespace: Syncfusion.WinForms.DataGrid.Styles
Assembly: Syncfusion.SfDataGrid.WinForms.dll
Syntax
public sealed class GridBorder : IFormattable, ICloneable, ISerializable, IXmlSerializable
Constructors
GridBorder()
Initializes a new instance of the GridBorder class.
Declaration
public GridBorder()
GridBorder(GridBorderStyle)
Initializes a new instance of the GridBorder class.
Declaration
public GridBorder(GridBorderStyle style)
Parameters
Type | Name | Description |
---|---|---|
GridBorderStyle | style | The GridBorderStyle of the border. |
GridBorder(GridBorderStyle, GridBorderWeight)
Initializes a new instance of the GridBorder class.
Declaration
public GridBorder(GridBorderStyle style, GridBorderWeight weight)
Parameters
Type | Name | Description |
---|---|---|
GridBorderStyle | style | The GridBorderStyle of the border. |
GridBorderWeight | weight | The GridBorderWeight of the border. |
GridBorder(GridBorderStyle, Color)
Initializes a new instance of the GridBorder class.
Declaration
public GridBorder(GridBorderStyle style, Color color)
Parameters
Type | Name | Description |
---|---|---|
GridBorderStyle | style | The GridBorderStyle of the border. |
System.Drawing.Color | color | A System.Drawing.Color of the border. |
GridBorder(GridBorderStyle, Color, GridBorderWeight)
Initializes a new instance of the GridBorder class.
Declaration
public GridBorder(GridBorderStyle style, Color color, GridBorderWeight weight)
Parameters
Type | Name | Description |
---|---|---|
GridBorderStyle | style | The GridBorderStyle style of the border. |
System.Drawing.Color | color | The System.Drawing.Color of the border. |
GridBorderWeight | weight | The GridBorderWeight of the border. |
GridBorder(Color)
Initializes a new instance of the GridBorder class.
Declaration
public GridBorder(Color color)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Color | color | The color of the border. |
GridBorder(Color, GridBorderWeight)
Initializes a new instance of the GridBorder class with the specified GridBorderStyle and System.Drawing.Color.
Declaration
public GridBorder(Color color, GridBorderWeight weight)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Color | color | A System.Drawing.Color specifying the color of the border. |
GridBorderWeight | weight | A GridBorderWeight specifying the thickness of the border. |
Fields
Empty
Maintains that the GridBorder is initialized or not.
Declaration
public static readonly GridBorder Empty
Field Value
Type |
---|
GridBorder |
Properties
Color
Gets the color value to be used for the cell border. This value comes from the System.Drawing.Color enumeration.
Declaration
public Color Color { get; }
Property Value
Type |
---|
System.Drawing.Color |
Info
Gets the value of ToString() method.
Declaration
public string Info { get; }
Property Value
Type |
---|
System.String |
IsEmpty
Gets a value indicating whether this GridBorder is uninitialized.
Declaration
public bool IsEmpty { get; }
Property Value
Type |
---|
System.Boolean |
Style
Gets the value of type of border line the cell has. This value comes from the GridBorderStyle enumeration.
Declaration
public GridBorderStyle Style { get; }
Property Value
Type |
---|
GridBorderStyle |
Weight
Gets the value of weight of the border the cell has. This value comes from the GridBorderWeight enumeration.
Declaration
public GridBorderWeight Weight { get; }
Property Value
Type |
---|
GridBorderWeight |
Width
Gets the value of width in pixels for the cell border.
Declaration
public int Width { get; }
Property Value
Type |
---|
System.Int32 |
Methods
Clone()
Creates an exact copy of this object.
Declaration
public object Clone()
Returns
Type | Description |
---|---|
System.Object | A GridBorder object. |
Compare(GridBorder, GridBorder)
Compares the given two objects.
Declaration
public static bool Compare(GridBorder lhs, GridBorder rhs)
Parameters
Type | Name | Description |
---|---|---|
GridBorder | lhs | The left-hand side of the operator. |
GridBorder | rhs | The right-hand side of the operator. |
Returns
Type | Description |
---|---|
System.Boolean | Boolean value. |
Equals(Object)
Overrides and determines whether the given object equals or not.
Declaration
public override bool Equals(object o)
Parameters
Type | Name | Description |
---|---|---|
System.Object | o | The object to be compared. |
Returns
Type | Description |
---|---|
System.Boolean | TrueIf it is equal; False otherwise. |
Overrides
GetHashCode()
Overrides and gets the hash code for the current GridBorder instance.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | Hash code. |
Overrides
MakeBlackAndWhite()
Returns a copy of this border object replacing the color with System.Drawing.Color.Black.
Declaration
public GridBorder MakeBlackAndWhite()
Returns
Type | Description |
---|---|
GridBorder | A GridBorder with black color. |
Parse(String)
Creates a GridBorder from a string.
Declaration
public static GridBorder Parse(string parseStr)
Parameters
Type | Name | Description |
---|---|---|
System.String | parseStr | The string to parse. |
Returns
Type | Description |
---|---|
GridBorder | A Syncfusion.WinForms.DataGrid.Styles.GridBorder.ReadString(System.String) that corresponds to parse String. |
Remarks
The output from ToString() should be consumable by Parse(String).
ReadXml(XmlReader)
De-serializes the contents of this object from an XML stream.
Declaration
public void ReadXml(XmlReader reader)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlReader | reader | Represents the XML stream. |
ToString()
Overrides and returns a string that represents the current object.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | A String that can be passed to Parse(String). |
Overrides
ToString(String, IFormatProvider)
Returns a string that represents the current object.
Declaration
public string ToString(string format, IFormatProvider formatProvider)
Parameters
Type | Name | Description |
---|---|---|
System.String | format | "Compact" for compact text; default is full text version. |
System.IFormatProvider | formatProvider | Format Provider. Ignored. |
Returns
Type | Description |
---|---|
System.String | A String that can be passed to Parse(String). |
WriteXml(XmlWriter)
Serializes the contents of this object into an XML stream.
Declaration
public void WriteXml(XmlWriter writer)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlWriter | writer | Represents the XML stream. |
Operators
Equality(GridBorder, GridBorder)
Performs the basic function of the "==" operator on the given two objects.
Declaration
public static bool operator ==(GridBorder lhs, GridBorder rhs)
Parameters
Type | Name | Description |
---|---|---|
GridBorder | lhs | The left-hand side of the operator. |
GridBorder | rhs | The right-hand side of the operator. |
Returns
Type | Description |
---|---|
System.Boolean | A boolean value. |
Inequality(GridBorder, GridBorder)
Performs the basic function of the "!=" operator on the given two objects.
Declaration
public static bool operator !=(GridBorder lhs, GridBorder rhs)
Parameters
Type | Name | Description |
---|---|---|
GridBorder | lhs | The left-hand side of the operator. |
GridBorder | rhs | The right-hand side of the operator. |
Returns
Type | Description |
---|---|
System.Boolean | Boolean value. |
Explicit Interface Implementations
ISerializable.GetObjectData(SerializationInfo, StreamingContext)
Implements the ISerializable interface and returns the data needed to serialize the GridBorder.
Declaration
void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
Parameters
Type | Name | Description |
---|---|---|
System.Runtime.Serialization.SerializationInfo | info | A SerializationInfo object containing the information required to serialize the object. |
System.Runtime.Serialization.StreamingContext | context | A StreamingContext object containing the source and destination of the serialized stream. |