ComponentOne True DBGrid for WinForms
How to Use Styles / Working with Style Properties / Anonymous Style Inheritance / Example 6 of 10: Changing the BackColor of the Style Property
In This Topic
    Example 6 of 10: Changing the BackColor of the Style Property
    In This Topic

    In the first example, setting the Font member of the grid's Style property affected the entire grid, including each caption bar, column header, and column footer. However, the same is not true of the BackColor and ForeColor properties. Since the built-in Caption, Heading, and Footing styles override both of these properties, only the data cells of the grid are displayed with a lavender background.


    The following code changes the font member of the Style property:

    To write code in Visual Basic

    Visual Basic
    Copy Code
    Me.C1TrueDBGrid1.Style.BackColor = System.Drawing.Color.Lavender
    

    To write code in C#

    C#
    Copy Code
    this.c1TrueDBGrid1.Style.BackColor = System.Drawing.Color.Lavender;
    
    See Also