Syncfusion.Grid.Windows
Members  Example 


GridBaseStyle Class

Implements the functionalities that represents base styles in the grid. A base style has a name and holds the GridStyleInfo object with style information. Cells in the grid can reference a base style with GridStyleInfo.BaseStyle.
Object Model
GridBaseStyle ClassGridBaseStylesMap ClassGridBaseStyle ClassGridStyleInfo ClassGridStyleInfoStore Class
Syntax
'Declaration
 
<TypeConverterAttribute(Syncfusion.Windows.Forms.Grid.GridBaseStyleConverter)>
<SerializableAttribute()>
Public Class GridBaseStyle 
   Inherits Syncfusion.ComponentModel.NonFinalizeDisposable
'Usage
 
Dim instance As GridBaseStyle
[TypeConverter(Syncfusion.Windows.Forms.Grid.GridBaseStyleConverter)]
[Serializable()]
public class GridBaseStyle : Syncfusion.ComponentModel.NonFinalizeDisposable 
Remarks
The grid has four system-defined base styles:
Name Descriptions
Standard Holds cell information for all cells.
Header Holds cell information for row and column headers.
Row Header Holds cell information specific to row headers.
Column Header Holds cell information specific to column headers.
You can format each cell in the grid individually, but settings that have not been initialized will be inherited from a base style whereas the standard style is the style that any cell will inherit information from.

You can register custom base styles with the GridBaseStylesMap map that you can access with GridModel.BaseStylesMap.

Base styles themselves can be inherited from other base styles. The "Row Header" base style is derived from the "Header" base style for example.

Example
The following example shows how to modify base styles and how to add a new custom base style:
GridStyleInfo standard = model.BaseStylesMap["Standard"].StyleInfo;
GridStyleInfo header = model.BaseStylesMap["Header"].StyleInfo;
GridStyleInfo rowHeader = model.BaseStylesMap["Row Header"].StyleInfo;
GridStyleInfo colHeader = model.BaseStylesMap["Column Header"].StyleInfo;
            
standard.TextColor = Color.FromArgb(0, 21, 84);
header.Interior = new BrushInfo(GradientStyle.Vertical, Color.FromArgb(238, 234, 216), Color.FromArgb(203, 199, 184));
rowHeader.Interior = new BrushInfo(GradientStyle.Horizontal, Color.FromArgb(238, 234, 216), Color.FromArgb(203, 199, 184));
standard.Font.Facename = "Helvetica";
standard.Interior = new BrushInfo(Color.FromArgb(237, 240, 247));
             
             
GridStyleInfo customStyle = model.BaseStylesMap["Custom Style"].StyleInfo;
standard.Interior = new BrushInfo(Color.Green);
    model[1, 1].BaseStyle = "Custom Style";
Inheritance Hierarchy

System.Object
   Syncfusion.ComponentModel.NonFinalizeDisposable
      Syncfusion.Windows.Forms.Grid.GridBaseStyle

AssemblyVersion

Syncfusion.Grid.Windows: 17.3460.0.26

See Also