True DBGrid for WinForms
コレクション
オブジェクトとコレクションの使用 > コレクション

コレクションは、グリッド列やスタイルなど、同種のデータアイテムをグループ化するためのオブジェクトです。一般に、C1TrueDBGrid 内の同種のアイテムは、コレクションとして実装されています。コレクションはオブジェクトなので、他のオブジェクトと同様にコード内で操作できます。C1TrueDBGrid では、次のコレクションが公開されています。

Collection Description
C1DataColumnCollection

グリッド内の0個以上の C1DataColumn オブジェクトを保持します。

The C1TrueDBGrid control and the C1TrueDBDropDown control both maintain a C1DataColumnCollection object to hold and manipulate C1DataColumn objects. This collection is contained under the C1TrueDBGrid object, and can be modified through the C1TrueDBGrid Designer. It can be accessed through the Columns property of the True DBGrid for WinForms controls.

C1DisplayColumnCollection

グリッド内の0個以上の C1DisplayColumn オブジェクトを保持します。

The C1TrueDBGrid control and the C1TrueDBDropDown control both maintain a C1DisplayColumnCollection object to hold and manipulate C1DisplayColumn objects. This collection is contained under the Split object, and is available through the Split's DisplayColumns property. In addition, this collection can be modified in .NET through the C1DisplayColumnCollection Editor.

GroupedColumnCollection

グループ化領域内の0個以上の C1DataColumn オブジェクトを保持します。

When the DataView property is set to DataViewEnum.GroupBy, a grouping area is created above the grid. This collection object represents the columns (C1DataColumn object) in the grouping area. As columns are dragged into or dragged out of the grouping area, the corresponding column in the collection will be added or deleted.

SelectedRowCollection

0個以上の選択された行インデックスを保持します。

When the user selects and highlights one or more rows of a C1TrueDBGrid control at run time, the row index of the selected rows are stored in the SelectedRowCollection object. In code, the Item property and IndexOf method of the collection can be used to determine which rows are selected. Also select and deselect records programmatically using its Add and RemoveAt methods.

SelectedColumnCollection

選択された列を表す0個以上のC1DataColumnオブジェクトを保持します。

When the user selects and highlights one or more columns of a C1TrueDBGrid control at run time, the C1DataColumn objects for those rows are stored in the SelectedColumnCollection object. In code, use the Item property and IndexOf method of the collection to determine which rows are selected. Also select and deselect records programmatically using its Add and RemoveAt methods.

SplitCollection

グリッド内の0個以上の Split オブジェクトを保持します。

The C1TrueDBGrid control maintains a SplitCollection collection to hold and manipulate Split objects. A grid has one split by default, but may contain multiple splits. This collection is accessed using the Splits property of the C1TrueDBGrid. In addition this collection can be modified in .NET through the Split Collection Editor.

GridStyleCollection

グリッドに含まれる、組み込みおよびユーザー定義の Style オブジェクトを保持します。

The C1TrueDBGrid and C1TrueDBDropDown controls store all built-in and user-defined Style objects in the GridStyleCollection object. Access the members of this collection by name in code, and then apply them to a grid, column, or split in order to control the appearance of the object in question. This collection is accessed using the Styles property in the True DBGrid for WinForms controls.

ValueItemCollection

列の0個以上のValueItem オブジェクトを保持します。

Each C1DataColumn object within a C1TrueDBGrid or C1TrueDBDropDown control stores its set of display value/value pairs in objects called ValueItem objects. The ValueItemCollection object is a collection of these pairs. This collection can be accessed through the Values property of the ValueItems object. For instance, in order to alter the first ValueItem in the collection, the code would look like:

C#
コードのコピー
this.c1TrueDBGrid.Columns[0].ValueItems.Values[0].DisplayValue = "Canada";