ComponentOne List for WinForms
In This Topic
    Referencing Splits and Their Properties
    In This Topic

    A C1List object initially contains a single horizontal split. If additional splits are created, you can determine or set the current split (that is, the split that has received focus) using the list's Split property:

    To write code in Visual Basic

    Visual Basic
    Copy Code
    ' Read the zero-based index of the current split.
    Variable = Me.C1List1.Split
    
    ' Set focus to the split with an index equal to Variable.
    Me.C1List1.Split = Variable
    

    To write code in C#

    C#
    Copy Code
    // Read the zero-based index of the current split.
    Variable = this.c1List1.Split;
    
    // Set focus to the split with an index equal to Variable.
    this.c1List1.Split = Variable;
    

    Each split in a list is a different view of the same data source, and behaves just like an independent list. If you create additional splits without customizing any of the split properties, all splits will be identical and each will behave very much like the original list with one split.

    Note that some properties are supported by both the C1List and Split objects. Three rules of thumb apply to properties that are common to a list and its splits:

    1. When you set or get the property of a Split object, you are accessing a specific split, and other splits in the same list are not affected.
    2. When you get the property of a C1List object, you are accessing the same property within the current split.
    3. When you set the property of a C1List object, you are setting the same property within all splits.

    To understand how these rules work in code, consider a list with two horizontal splits, and assume that the current split index is 1.

    See Also