Syncfusion.Grid.Windows
Members  Example 


Syncfusion.Windows.Forms.Grid Namespace : GridBaseStylesMap Class

GridBaseStylesMap Class

Implements the functionalities that holds a collection of base styles for a grid and lets you add, remove, and change base styles.
Object Model
GridBaseStylesMap ClassGridBaseStyle Class
Syntax
'Declaration
 
<DefaultMemberAttribute("Item")>
<EditorAttribute(Syncfusion.Windows.Forms.Grid.GridBaseStyleCollectionEditor, System.Drawing.Design.UITypeEditor)>
<SerializableAttribute()>
Public Class GridBaseStylesMap 
   Inherits Syncfusion.ComponentModel.NonFinalizeDisposable
'Usage
 
Dim instance As GridBaseStylesMap
[DefaultMember("Item")]
[Editor(Syncfusion.Windows.Forms.Grid.GridBaseStyleCollectionEditor, System.Drawing.Design.UITypeEditor)]
[Serializable()]
public class GridBaseStylesMap : Syncfusion.ComponentModel.NonFinalizeDisposable 
Remarks
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.

The grid has four system-defined base styles as discussed in GridBaseStyle overview. The RegisterStandardStyles method adds these system styles to the collection.

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

Use ShowGridBaseStylesMapDialog(Object,String) to let users customize base styles at run-time.

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.GridBaseStylesMap

AssemblyVersion

Syncfusion.Grid.Windows: 17.3460.0.26

See Also