ComponentOne List for WinForms
In This Topic
    Adjusting the Height of All List for WinForms Rows
    In This Topic

    You can configure the row height interactively at design time by placing the list in its visual editing mode or by changing the list's ItemHeight property in the Properties window. At run time, the user can adjust the row height interactively if AllowRowSizing is set to AllRows or IndividualRows. For more information, see Run-Time Interaction.

    The ItemHeight property is expressed in units of the container's coordinate system. However, a setting of 0 causes the list to readjust its display so that each row occupies a single line of text in the current font. Therefore, you can use the following code to adjust the row height to display exactly three lines of text:

    To write code in Visual Basic

    Visual Basic
    Copy Code
    Me.C1List1.ItemHeight = 3 * Me.C1List1.ItemHeight
    

    To write code in C#

    C#
    Copy Code
    this.c1List1.ItemHeight = 3 * this.c1List1.ItemHeight;
    

    This technique is particularly effective when displaying multiple-line memo fields, as in this example:

    Note that the Description column's Style object must have its WrapText property set to True; otherwise, the memo field display will be truncated after the first line.