ComponentOne True DBGrid for .NET (2.0) Search HelpCentral 

Modifying Named Styles

Change the appearance of the overall grid at design time by using .NET’s collection editors to modify the GridStyleCollection. For example, to force all column headers to center their caption text, change the HorizontalAlignment property of the built-in Heading style to AlignHorzEnum.Center.

The following statement accomplishes the same result in code:

·      Visual Basic

Me.C1TrueDBGrid1.Styles("Heading").HorizontalAlignment = AlignHorzEnum.Center

·      C#

this.C1TrueDBGrid1.Styles["Heading"].HorizontalAlignment = AlignHorzEnum.Center;

·      Delphi

Self.C1TrueDBGrid1.Styles['Heading'].HorizontalAlignment = AlignHorzEnum.Center;

However, it is not necessary to use the C1TrueDBGrid Style Editor or manipulate named members of the GridStyleCollection in code, as the grid and its component objects expose several properties that return Style objects. As the next section describes, the appearance of the grid can be fine-tuned by manipulating these objects directly. For more information see Using the C1TrueDBGrid Style Editor.


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