True DBGrid for WinForms | ComponentOne
Split Presentation / Columns in Splits
In This Topic
    Columns in Splits
    In This Topic

    Each split in a True DBGrid for WinForms control maintains its own collection of columns. The C1DisplayColumnCollection object provides access to both split-specific display properties for columns inside a split. The split-specific properties of the C1DisplayColumnCollection allow for tremendous flexibility in controlling the look and behavior of individual splits. The grid is connected to a single data source, so the splits just present different views of the same data. Therefore, the C1DisplayColumnCollection in each split contains the same number of columns and the columns are bound to the same data fields.

    However, the values of other C1DisplayColumn object properties, such as Visible, may vary from split to split. These properties are said to be split-specific. For example, a column created in code is not visible by default. Thus, the LastName column created in the preceding example is invisible in all splits. The following code makes it visible in the second split:

    C#
    Copy Code
    //make columns 0 and 1 visible in split 1
    c1TrueDBGrid1.Splits[1].DisplayColumns[0].Visible = true;
    c1TrueDBGrid1.Splits[1].DisplayColumns[1].Visible = true;
    

    Since Visible is a split-specific property, the LastName column remains invisible in other splits.