\
ComponentOne List for WinForms
Design-Time Support / Using the C1DisplayColumn Collection Editor
In This Topic
    Using the C1DisplayColumn Collection Editor
    In This Topic

    The C1DisplayColumnCollection is a collection of the column properties which relate to display, color, font, and so on. These properties are contained under the Columns identifier under the SplitCollection. These properties are also split-specific, as each C1DisplayColumn property can have a different value in different splits. Accessing these properties in code is done through this SplitCollection and is demonstrated by the following:

    To write code in Visual Basic

    Visual Basic
    Copy Code
    Me.C1List1.Splits(0).DisplayColumns(0).Width = 50
    

    To write code in C#

    C#
    Copy Code
    this.c1List1.Splits[0].DisplayColumns[0].Width = 50;
    

    Given the List for WinForms' object model with its split-specific column properties and diverse collections, many of its properties might be tough to find and set efficiently. Luckily, .NET contains collection editors which help in categorizing and setting the C1List collection properties. The Split Collection Editor can be accessed by clicking the ellipsis button next to the Splits property of the list in the Properties window. In the C1DisplayColumn Collection Editor, click the ellipsis button next to the DisplayColumns property to bring up the editor.

    The editor has two panes. The left pane contains the current columns in the list under the Members heading. Notice that the editor doesn't contain buttons to add and delete columns. Even though you aren't able to use the collection editor to create and delete columns, you still are able to accomplish this at design-time. The right pane contains the display-related properties for the specific column highlighted in the left pane.

    Notice that there aren't any add or remove buttons in the C1DisplayColumn Collection Editor. Due to the fact that there can be multiple DisplayColumns for each split in the list, the addition or deletion of columns must occur in the C1List Designer. This ensures that a column is added to all splits, or removed from all splits.

    See Also