Class GridStyleInfoSubObject
GridStyleInfoSubObject is an abstract base class for classes to be used as sub-objects in a GridStyleInfo.
Inheritance
Implements
Inherited Members
Namespace: Syncfusion.Windows.Forms.Grid
Assembly: Syncfusion.Grid.Windows.dll
Syntax
public abstract class GridStyleInfoSubObject : StyleInfoSubObjectBase, ICustomTypeDescriptor, IDisposable, IStyleInfo, ISupportInitialize, IFormattable, IConvertible, IXmlSerializable, IStyleInfoSubObject
Remarks
GridStyleInfoSubObject is derived from StyleInfoBase and thus provides the same easy way to provide properties that can inherit values from base styles at run-time.
The difference is that GridStyleInfoSubObject supports this inheritance mechanism as a sub-object from a GridStyleInfo. A sub-object needs to have knowledge about its parent object and be able to walk the base styles from the parent object.
Examples for implementation of GridStyleInfoSubObject are the font and border classes in Essential Grid.
Programmers can derive their own style classes from GridStyleInfoSubObject and add type-safe (and intelli-sense) supported custom properties to the style class. If you write your own SpinButton class that needs individual properties, simply add a CellSpinButtonInfo class as subobject. If you derive CellSpinButtonInfo from GridStyleInfoSubObject, your new object will support property inheritance from base styles.
See the overview for StyleInfoBase for further discussion about style objects.
Examples
The following example shows how you can use the GridFontInfo class in Essential Grid:
standard.Font.Facename = "Helvetica";
model[1, 3].Font.Bold = true;
string faceName = model[1, 3].Font.Facename; // any cell inherits standard style
Console.WriteLIne(faceName); // will output "Helvetica"
Console.WriteLIne(model[1, 3].Font.Bold); // will output "true"
Console.WriteLIne(model[1, 3].Font.HasFaceName); // will output "False"
Constructors
GridStyleInfoSubObject(StyleInfoStore)
Initalizes a new instance of GridStyleInfoSubObject class and associates it with an existing StyleInfoStore.
Declaration
public GridStyleInfoSubObject(StyleInfoStore store)
Parameters
Type | Name | Description |
---|---|---|
StyleInfoStore | store | A StyleInfoStore that holds data for this object. All changes in this style object will be saved in the StyleInfoStore object. |
GridStyleInfoSubObject(StyleInfoSubObjectIdentity, StyleInfoStore)
Initalizes a new instance of GridStyleInfoSubObject class and associates it with an existing StyleInfoStore.
Declaration
public GridStyleInfoSubObject(StyleInfoSubObjectIdentity identity, StyleInfoStore store)
Parameters
Type | Name | Description |
---|---|---|
StyleInfoSubObjectIdentity | identity | A StyleInfoSubObjectIdentity that holds the indentity for this StyleInfoBase. A StyleInfoStore that holds data for this object. All changes in this style object will saved in the StyleInfoStore object. |
StyleInfoStore | store |
Properties
Info
Gets results of ToString method.
Declaration
public string Info { get; }
Property Value
Type |
---|
System.String |
Methods
GetActiveGridView()
Returns the active GridControlBase for the GridModel this style belongs to or NULL if the style is used outside a grid model.
Declaration
public GridControlBase GetActiveGridView()
Returns
Type | Description |
---|---|
GridControlBase | A reference to the grid control base or NULL if the style is used outside a grid model. |
GetCellIdentity()
Return the GridStyleInfoIdentity with identity information about the parent style.
Declaration
public GridStyleInfoIdentity GetCellIdentity()
Returns
Type | Description |
---|---|
GridStyleInfoIdentity | The parent style's identity object. |
GetGridModel()
Returns the GridModel this style belongs to or NULL if the style is used outside a grid model.
Declaration
public GridModel GetGridModel()
Returns
Type | Description |
---|---|
GridModel | A reference to the grid model or NULL if the style is used outside a grid model. |
Examples
This example shows how to get the GridModel.
//Get the grid model.
GridModel model = this.gridControl1.TableStyle.GetGridModel();
'Get the grid model.
Dim model As GridModel= Me.gridControl1.TableStyle.GetGridModel()
GetGridStyleInfo()
Returns the GridStyleInfo this subobject belongs to.
Declaration
public GridStyleInfo GetGridStyleInfo()
Returns
Type | Description |
---|---|
GridStyleInfo | The parent style object. |
ToString()
Returns a string holding the current object.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | String representation of the current object. |