![]() |
![]() |
The BeeGrid uses a style model to simplify customization of grid's appearance. BeeGrid styles are organized in a Style hierarchy with the "Normal" style in the hierarchy root. Following list shows predefined styles and their relationship.
Normal | Root of the style hierarchy. Attributes of this style are applied when no other style defines particular attribute. |
Heading | Applied to the row and column headings. |
Caption | Applied to the grid caption. |
Selection | Applied to the selection. |
InactiveSelection | Applied to the selection when grid doesn't have input focus. |
CurrentRow | Applied to all cells in a current row. |
CurrentCell | Applied to the current cell. |
FilteredRow | Applied to the filtered row. |
FrozenRow | Applied to the frozen row. |
GroupHeader | Applied to the group headers. |
GroupFooter | Applied to the group footers. |
Tip | Applied to the cell and scroll tips. |
PreviewPane | Applied to the preview pane. |
GroupByBox | Applied to the group-by box. |
GroupByBoxCell | Applied to cells inside the group-by box. |
GridBackground | Applied to the grid background. |
Each SGStyle object encapsulates appearance attributes such as a font, picture, color, Alpha blending or formatting. Style hierarchy enables attribute inheritance, so for example, if color is not initialized in one style, it is inherited from a parent style.
When BeeGrid draws a particular cell it uses styles applied to that cell to determine its appearance. This is a list that defines the order in which styles are applied.
Grid's "Normal" style.
Style from the row's Style property
Style from the column's Style property.
Conditional styles from the RowStyleConditions collection. Styles are applied in their collection order.
Conditional styles from the StyleConditions collection. Styles are applied in their collection order.
Conditional styles from the CellStyleConditions collection. Styles are applied in their collection order.
If cell is a member of the group header or footer row, "GroupHeader" or "GroupFooter" styles are applied.
If cell is a row or column heading, "HeadingStyle" is applied.
If cell is a column heading cell, style from the column's HeadingStyle property
If cell is a row heading cell, style from the first column's Style property.
Style from the cell's Style property.
Even/odd row colors.
You can create your own styles with the Add method of the SGStyles collection.
Dim sty As SGStyle
Set sty = SGGrid1.Styles.Add("MyStyle")
Dim sty As SGStyle
Set sty = SGGrid.Styles("Normal")