ComponentOne True DBGrid for WinForms
How to Use Styles / Working with Style Properties / Anonymous Style Inheritance / Example 1 of 10: Inheriting from Containing Splits
In This Topic
    Example 1 of 10: Inheriting from Containing Splits
    In This Topic

    Since the default values of all built-in styles are in effect, columns inherit from their containing splits, which in turn inherit from the grid as a whole. Therefore, this statement affects not only data cells, but also all headers, footers, and caption bars. This statement has the same visual effect as changing the Normal style directly using the C1TrueDBGrid Style Editor; however, the built-in Normal style itself is not changed.


    The following code inherits values from the containing splits:

    To write code in Visual Basic

    Visual Basic
    Copy Code
    Dim myfont As Font
    myfont = New Font (Me.C1TrueDBGrid1.Styles("Normal").Font, FontStyle.Bold)
    Me.C1TrueDBGrid1.Styles("Normal").Font = myfont
    

    To write code in C#

    C#
    Copy Code
    Font myfont;
    myfont = new Font (this.c1TrueDBGrid1.Styles["Normal"].Font, FontStyle.Bold);
    this.c1TrueDBGrid1.Styles["Normal"].Font = myfont;
    
    See Also