The following list defines the order in which cell styles are applied relative to the anonymous styles of a grid, split, or column:
1. Style property, C1TrueDBGrid control. The default named parent of this anonymous style is Normal.
2. Style property, Split object. By default, this anonymous style inherits from its C1TrueDBGrid control counterpart.
3. EvenRowStyle and OddRowStyle properties, Split object. By default, these anonymous styles inherit from their C1TrueDBGrid control counterparts, which in turn have default named parents of EvenRow and OddRow. These properties apply only if the AlternatingRows property is True.
4. Style property, C1DisplayColumn object. By default, this anonymous style inherits from its Split object counterpart.
5. FetchRowStyle event. This event fires only if the FetchRowStyles property is True for a grid or split.
6. SelectedStyle property, Split object. By default, this anonymous style inherits from its C1TrueDBGrid control counterpart, which in turn has a default named parent of Selected. This property applies only to selected rows; that is, rows whose bookmarks have been added to the SelectedRowCollection through code or user interaction.
7. HighlightRowStyle property, Split object. By default, this anonymous style inherits from its C1TrueDBGrid control counterpart, which in turn has a default named parent of HighlightRow. This property applies only to highlighted rows,, the current row in a grid or split whose MarqueeStyle property is set to MarqueeEnum.HighlightRow or MarqueeEnum.HighlightRowRaiseCell.
8. AddCellStyle and AddRegexCellStyle methods, if called. Cell styles specified at the C1DisplayColumn object level have the highest priority, followed by those specified at the Split object and C1TrueDBGrid control levels. Within an object level, cell styles are tested in the order in which they were added in code. Cell styles do not inherit from one another; as soon as a match is found, testing stops.
9. FetchCellStyle event. This event fires only if the FetchStyle property is True for a C1DisplayColumn object.
Thus, you always have final control over the rendering of a cell via the FetchCellStyle event.
Send comments about this topic to ComponentOne. Copyright © ComponentOne LLC. All rights reserved. |