ComponentOne True DBGrid for .NET (2.0) Search HelpCentral 

Setting the Column's Caption Height

To set the column's caption height, set the ColumnCaptionHeight property. This can be set either in the designer or in code.

In the Designer

1.   Open the TrueDBGrid Designer. For information on how to access the TrueDBGrid Designer, see Accessing the TrueDBGrid Designer.

2.   Click the Split tab in the left pane.

3.   Locate the ColumnCaptionHeight property and set it to 34.

4.   Click the Column tab.

5.   Locate the Caption property and change it from First to Composer's First Name.

6.   Click OK to close the TrueDBGrid Designer.

In Code

1.   Set the ColumnCaptionHeight property to fit two rows by adding the following code to the Form_Load event:

·      Visual Basic

Me.C1TrueDBGrid1.Splits(0).ColumnCaptionHeight = Me.C1TrueDBGrid1.Splits(0).ColumnCaptionHeight * 2

·      C#

this.c1TrueDBGrid1.Splits[0].ColumnCaptionHeight = this.c1TrueDBGrid1.Splits[0].ColumnCaptionHeight * 2;

·      Delphi

Self.C1TrueDBGrid1.Splits[0].ColumnCaptionHeight := Self.C1TrueDBGrid1.Splits[0].ColumnCaptionHeight * 2;

2.   Set the Caption property:

·      Visual Basic

Me.C1TrueDBGrid1.Columns(0).Caption = "Composer's First Name"

·      C#

this.c1TrueDBGrid1.Columns[0].Caption = "Composer's First Name";

·      Delphi

Self.C1TrueDBGrid1.Columns[0].Caption := 'Composer''s First Name';

This topic illustrates the following:

The caption in the row containing first names is set to Composer's First Name and spans two rows.


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