ComponentOne List for WinForms
In This Topic
    Example 10 - Setting the Alignment for Column Headers and Footers
    In This Topic

    This example illustrates the distinction between general and specific alignment for column headers and footers. If the HorizontalAlignment member of the HeadingStyle (or FooterStyle) property is not set to General, then the header (or footer) is aligned independently of the data cells.

    The following code sets the alignment for column headers:

    To write code in Visual Basic

    Visual Basic
    Copy Code
    Me.C1List1.Splits(0).DisplayColumns(0).HeadingStyle.HorizontalAlignment = C1.Win.C1List.AlignHorzEnum.Near        
    Me.C1List1.Splits(0).DisplayColumns(0).FooterStyle.HorizontalAlignment = C1.Win.C1List.AlignHorzEnum.Far        
    Me.C1List1.Splits(0).DisplayColumns(0).Style.HorizontalAlignment = C1.Win.C1List.AlignHorzEnum.Center
    

    To write code in C#

    C#
    Copy Code
    this.c1List1.Splits[0].DisplayColumns[0].HeadingStyle.HorizontalAlignment = C1.Win.C1List.AlignHorzEnum.Near;        
    this.c1List1.Splits[0].DisplayColumns[0].FooterStyle.HorizontalAlignment = C1.Win.C1List.AlignHorzEnum.Far;       
    this.c1List1.Splits[0].DisplayColumns[0].Style.HorizontalAlignment = C1.Win.C1List.AlignHorzEnum.Center;