Description:
I'm using the XtraGrid and handle its RowCellStyle event for conditional cell highlighting. Currently, a fixed (constant) color is assigned to the cell's background. I'd rather want to use colors, which match the currently used appearance theme, which is set in the DefaultLookAndFeel control. Please note that end-users of my application can select one of the available skins that they prefer.
Answer:
There are two solutions to your task.
- You can try to "translate" a standard system color to the corresponding replacement color, defined in our skin:
How to convert a standard color to a color which corresponds to the current skin - Use the color of a particular control's element for cell highlighting:
How to obtain the color of a particular control's element when skins are used
To find a skin element with an appropriate color, please launch the SkinEditor tool, create a new skin project and look for the necessary element in the tree view.
Please note that most skin elements are painted via images, i.e. a picture defined in the skin assembly is stretched to fill the entire element's boundaries. When you decide to use the second solution listed above, ensure to select the skin element with the BackColor assigned (non-Empty). As for the first solution, please keep in mind that not all system colors are re-defined in a given skin. Here is a screenshot of the SkinEditor. It shows where to look for the skin specific colors.
See Also:
How to get skin images at runtime