ComponentOne True DBGrid for .NET (2.0) Search HelpCentral 

Multiple-Line Headers and Footers

The split specific property ColumnCaptionHeight property controls the height of the column headers. By default, it is based upon the font setting of the HeadingStyle. To display more than one line of text in a column header, increase the ColumnCaptionHeight property to accommodate additional lines, as in the following example:

·      Visual Basic

With Me.C1TrueDBGrid1

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

    .Columns(0).Caption = "First line" + vbCrLf + "Second line"

End With

·      C#

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

this.c1TrueDBGrid1.Columns[0].Caption = "First line\nSecond line";

·      Delphi

With Self.C1TrueDBGrid1 do

begin

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

  Columns[0].Caption := 'First line' + #13#10 + 'Second line';

end;

Note the use of the to specify a line break within the caption text. After this code executes, the first column's caption will contain two lines of text, and the second column's caption will be centered vertically.

Similarly, set the ColumnFooterHeight property to control the height of column footers, and use the constant to specify a line break when setting the FooterText property of a column.


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