ComponentOne True DBGrid for .NET (2.0) Search HelpCentral 

Working with Columns in Splits

Each split in a True DBGrid for .NET 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:

·      Visual Basic

Me.C1TrueDBGrid1.Splits(1).DisplayColumns("LastName").Visible = True

·      C#

this.C1TrueDBGrid1.Splits(1).DisplayColumns("LastName").Visible = true;

·      Delphi

Self.C1TrueDBGrid1.Splits[1].DisplayColumns['LastName'].Visible := True;

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


Send comments about this topic to ComponentOne.
Copyright © ComponentOne LLC. All rights reserved.