ComponentOne True DBGrid for .NET (2.0) Search HelpCentral 

C1DisplayColumn.HeadingStyle Property

Gets or sets the Style that controls the appearance of the column headers.

[Visual Basic]

Public Property HeadingStyle As C1.Win.C1TrueDBGrid.Style

[C#]

public C1.Win.C1TrueDBGrid.Style HeadingStyle {get;set;}

[Delphi]

public property HeadingStyle: C1.Win.C1TrueDBGrid.Style read get_HeadingStyle write set_HeadingStyle;

Example

The following code uses the HeadingStyle property to modify the appearance of the column headers, making all headers blue, System.SmallCaptionFont font style with center alignment:

·      Visual Basic

       Dim C As C1.Win.C1TrueDBGrid.C1DisplayColumn

       For Each C In Me.C1TrueDBGrid1.Splits(0).DisplayColumns

           C.HeadingStyle.ForeColor = Color.Blue

           C.HeadingStyle.HorizontalAlignment = C1.Win.C1TrueDBGrid.AlignHorzEnum.Center

           C.HeadingStyle.Font = SystemFonts.SmallCaptionFont

       Next

·      C#

       foreach (C1.Win.C1TrueDBGrid.C1DisplayColumn C in this.c1TrueDBGrid1.Splits[0].DisplayColumns)

       {

           C.HeadingStyle.ForeColor = Color.Blue;

           C.HeadingStyle.HorizontalAlignment = C1.Win.C1TrueDBGrid.AlignHorzEnum.Center;

           C.HeadingStyle.Font = SystemFonts.SmallCaptionFont;

       }

·      Delphi

       var

         C: C1.Win.C1TrueDBGrid.C1DisplayColumn;

       begin

         for C in Self.C1TrueDBGrid1.Splits[0].DisplayColumns do

         begin

           C.HeadingStyle.ForeColor := Color.Blue;

           C.HeadingStyle.HorizontalAlignment := C1.Win.C1TrueDBGrid.AlignHorzEnum.Center;

           C.HeadingStyle.Font := SystemFonts.SmallCaptionFont;

         end;

       end;

See Also

C1DisplayColumn Class | C1DisplayColumn Members | C1.Win.C1TrueDBGrid Namespace


Send comments about this topic to ComponentOne.
Copyright © ComponentOne LLC. All rights reserved.