ComponentOne True DBGrid for .NET (2.0) Search HelpCentral 

Using the C1DisplayColumnCollection Editor

The C1DisplayColumnCollection is a collection of the column properties which relate to display, color, font, etc. These properties are contained under the Columns identifier under the SplitCollection. These properties are also split-specific; each C1DisplayColumn property can have a different value in different splits. Accessing these properties in code is done through this SplitCollection, and is demonstrated by the following:

·      Visual Basic

Me.C1TrueDBGrid1.Splits(0).DisplayColumns(0).Merge = True

·      C#

this.C1TrueDBGrid1.Splits(0).DisplayColumns(0).Merge = true;

·      Delphi

Self.C1TrueDBGrid1.Splits[0].DisplayColumns[0].Merge := True;

Given the True DBGrid’s object model with its split-specific column properties and diverse collections, many of its properties might be tough to find and set efficiently. Luckily, .NET contains collection editors which help in categorizing and setting the C1TrueDBGrid’s collection properties. This editor is accessible through the Split Collection Editor, which can be accessed by clicking on the ellipsis button (…) next to the Splits property of the grid in the Properties window. In the Split Collection Editor, clicking on the ellipsis button next to the DisplayColumns property will bring up the editor.

 

The editor has two panes. The left pane contains the current columns in the grid under the Members heading. By clicking on the Add or Remove buttons the columns in the left pane can be created or deleted accordingly. The right pane contains the display-related properties for the specific column highlighted in the left pane. 

Notice that there are not any add or remove buttons in the C1DisplayColumnCollection Editor. Due to the fact that there can be multiple DisplayColumns for each split in the grid, the addition or deletion of columns must occur in the C1TrueDBGrid Designer. This ensures that a column is added to all splits, or removed from all splits.


DisplayColumns Properties


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