ComponentOne List 8.0 for ActiveX
Working with Columns in Splits

Each split in a True DBList control maintains its own Columns collection. This provides tremendous flexibility for controlling the look and behavior of individual splits. The list is connected to a single data source, so the splits just present different views of the same data. Therefore, the Columns collection in each split contains the same number of columns and the columns are bound to the same data fields.

Note that some Column object properties, such as Caption and DataField, have the same value in each split. These properties are said to be global. For example, given a list with two splits, the following code will always print the same values for a given column index n:

Example Title
Copy Code
Debug.Print TDBList1.Splits(0).Columns(n).Caption

Debug.Print TDBList1.Splits(1).Columns(n).Caption

Debug.Print TDBList1.Columns(n).Caption

More importantly, if you set any of the global properties of a column within a particular split, that property will be set to the same value for all splits. For example, the following code will append a column to all splits (not just the first one) and bind the columns to the same database field (LastName).

Example Title
Copy Code
Dim Cols As TrueDBList80.Columns

Set Cols = TDBList1.Splits(0).Columns

 

' Append a column to the end of the Columns collection

Dim C As TrueDBList80.Column

Set C = Cols.Add(Cols.Count)

 

' Set the DataField property of the newly created column

C.DataField = "LastName"

However, the values of other Column object properties, such as Visible and BackColor, may vary from split to split. These properties are said to be split-specific. For example, a column created at run time 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:

Example Title
Copy Code
TDBList1.Splits(1).Columns("LastName").Visible = True

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

See Also

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Product Support Forum  |  Documentation Feedback