ComponentOne List for WinForms
In This Topic
    Multiple-Line Headers and Footers
    In This Topic

    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 property. If you need to display more than one line of text in a column header, you can increase the ColumnCaptionHeight property to accommodate additional lines, as in the following example:

    To write code in Visual Basic

    Visual Basic
    Copy Code
    Me.C1List1.Splits(0).ColumnCaptionHeight = Me.C1List1.Splits(0).ColumnCaptionHeight * 2    
    Me.C1List1.Columns(0).Caption = "First line" + vbNewLine + "Second line"
    

    To write code in C#

    C#
    Copy Code
    this.c1List1.Splits[0].ColumnCaptonHeight = this.c1List1.Splits[0].ColumnCaptonHeight * 2;    
    this.c1List1.Columns[0].Caption = "First line \n" + "Second line";
    

    Note the use of the constant 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, you can set the ColumnFooterHeight property to control the height of column footers, and use the vbCr constant to specify a line break when setting the FooterText property of a column.