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:
To write code in Visual Basic
Visual Basic |
Copy Code
|
---|---|
Me.C1TrueDBGrid1.Splits(1).DisplayColumns("LastName").Visible = True |
To write code in C#
C# |
Copy Code
|
---|---|
this.c1TrueDBGrid1.Splits(1).DisplayColumns("LastName").Visible = true; |
Since Visible is a split-specific property, the LastName column remains invisible in other splits.