# Objects

## Content

**TrueDbGrid** provides a rich set of properties, methods, and events that enable you to develop sophisticated database applications.
Objects and collections that refer to visual entities, such as columns, can be customized in the designer or in code. Objects and collections that refer to abstract entities, such as arrays and bookmarks are only available in code.
Two controls are available in the .NET Toolbox for addition into a project:

### [C1TrueDbGrid](/componentone/docs/win/online-truedbgrid/)

**TrueDBGrid for WinForms** grid control. The **C1TrueDBGrid** control is the primary object of **TrueDBGrid for WinForms**. Use its [C1DataColumnCollection](/componentone/docs/win/online-truedbgrid/) and [C1DisplayColumnCollection](/componentone/docs/win/online-truedbgrid/) objects to create, access, and modify the column objects that define the mappings between the grid's physical columns and the underlying database fields. Using its [SplitCollection](/componentone/docs/win/online-truedbgrid/) object, the grid can be divided into multiple horizontal or vertical panes to provide different views of the same data source.

### [C1TrueDBDropDown](/componentone/docs/win/online-truedbgrid/)

**True DBGrid for WinForms** drop-down box control. The [C1TrueDBDropDown](/componentone/docs/win/online-truedbgrid/) control, which is a subset of the **C1TrueDBGrid** control, is used as a multicolumn drop-down list box for a grid column. The C1TrueDBDropDown control cannot be used as a standalone control. In the designer, place a C1TrueDBDropDown control on a form just as you would a **C1TrueDBGrid** control. However, the drop-down control will be invisible at run time unless it is attached to a [C1DataColumn](/componentone/docs/win/online-truedbgrid/) object of a [C1TrueDBGrid](/componentone/docs/win/online-truedbgrid/) control. To use the drop-down control, set the [DropDown](/componentone/docs/win/online-truedbgrid/) property of a grid column to the name of a C1TrueDBDropDown control at either in the designer or in code. At run time, when the user clicks the in-cell button for that column, the C1TrueDBDropDown control will appear below the grid's current cell. If the user selects an item from the drop-down control, the grid's current cell is updated. The C1TrueDBDropDown control also supports incremental search.
The namespace for **TrueDBGrid for WinForms** also contains definitions for the following objects.

### [C1DataColumn](/componentone/docs/win/online-truedbgrid/)

Represents a column of data within a grid. Each column within a [C1TrueDBGrid](/componentone/docs/win/online-truedbgrid/) or [C1TrueDBDropDown](/componentone/docs/win/online-truedbgrid/) control is represented by two column objects, one global and one split-specific. All of the properties related to data access and formatting are contained under the [C1DataColumn](/componentone/docs/win/online-truedbgrid/) object. The properties of the **C1DataColumn** object are global in scope; changing a C1DataColumn property changes that value for all columns, even across splits. The C1DataColumn object can be accessed as follows:

```vbnet
Me.C1TrueDBGrid1.Columns(0).Caption = "Region"                                 
```

```csharp
this.c1TrueDBGrid1.Columns[0].Caption = "Region";                                   
```

### [C1DisplayColumn](/componentone/docs/win/online-truedbgrid/)

Represents a column of data relative to a split. Each split within the grid contains at least one [C1DisplayColumn](/componentone/docs/win/online-truedbgrid/) object. All of the properties related to a column's display are contained under this object. Unlike the [C1DataColumn](/componentone/docs/win/online-truedbgrid/) properties, the properties of the **C1DisplayColumn** object are split-specific. Changing a C1DisplayColumn property will change that value for only the specified column inside the specified split. The object can be accessed as follows:

```vbnet
Me.C1TrueDBGrid1.Splits(0,0).DisplayColumns(0).Style.ForeColor = System.Drawing.Color.Blue                                   
```

```csharp
this.c1TrueDBGrid1.Splits[0,0].DisplayColumns[0].Style.ForeColor = System.Drawing.Color.Blue;                                  
```

### [GridLines](/componentone/docs/win/online-truedbgrid/)

Represents the gridlines which separate items in the grid. The [GridLines](/componentone/docs/win/online-truedbgrid/) object is used to specify characteristics of the [ColumnDivider](/componentone/docs/win/online-truedbgrid/) and [RowDivider](/componentone/docs/win/online-truedbgrid/) properties. Both the color and style of the column and row lines can be manipulated at run time or design time through the use of the **GridLines** object.

### [HBar](/componentone/docs/win/online-truedbgrid/)

Represents the horizontal scroll bar and its properties. The [HBar](/componentone/docs/win/online-truedbgrid/) object is used to specify properties of the horizontal scrollbar. Through the use of the [HScrollBar](/componentone/docs/win/online-truedbgrid/) property, the developer can specify the width of the scroll bar, and whether is shows up automatically or not at all.

### **PrintPreviewWinSettings**

Encapsulates the print preview window and its properties. The **PrintPreviewWinSettings** object provides access to properties of the Print Preview window of the grid. Through this object, page headers, page footers, and other visual aspects can be set to the preview window. This object is accessed through the [PreviewInfo](/componentone/docs/win/online-truedbgrid/) property of the [C1TrueDBGrid](/componentone/docs/win/online-truedbgrid/) control.

### [PrintInfo](/componentone/docs/win/online-truedbgrid/)

Encapsulates page setup and print job settings.
The [PrintInfo](/componentone/docs/win/online-truedbgrid/) object is used to specify page layout and print job characteristics such as the name of the output device, margin settings, page headers and footers, and the number of copies to print.
The [PrintInfo](/componentone/docs/win/online-truedbgrid/) property of a [C1TrueDBGrid](/componentone/docs/win/online-truedbgrid/) control returns the object that modifies the print job.
The **PrintInfo** object is persistent, which means that a print layout can be defined at design time, and then recalled in code at run time.

### [Split](/componentone/docs/win/online-truedbgrid/)

Represents a group of adjacent columns that scroll as a unit. **TrueDBGrid for WinForms** supports Excel-like splits that divide the grid into vertical and horizontal panes to provide users with different views of the data source. Each split is represented by a [Split ](/componentone/docs/win/online-truedbgrid/)object and contains a group of adjacent columns that scroll as a unit. When a [C1TrueDBGrid](/componentone/docs/win/online-truedbgrid/) control is created, it contains one **Split** object by default. Many of the properties of the Split object also apply to the **C1TrueDBGrid** control as a whole, so there is no need to be concerned with splits until needed such as when creating fixed, non-scrolling columns. The object can be accessed as follows:

```vbnet
Me.C1TrueDBGrid1.Splits(0).Caption = "Split00"                                  
```

```csharp
this.c1TrueDBGrid1.Splits[0].Caption = "Split00";                                  
```

### [Style](/componentone/docs/win/online-truedbgrid/)

Encapsulates font, color, picture, and formatting information. [Style](/componentone/docs/win/online-truedbgrid/) objects encapsulate font, color, picture, and formatting information for a [C1TrueDBGrid](/componentone/docs/win/online-truedbgrid/), [C1TrueDBDropDown](/componentone/docs/win/online-truedbgrid/), [Split](/componentone/docs/win/online-truedbgrid/), or [C1DisplayColumn](/componentone/docs/win/online-truedbgrid/) object. The **Style** object is a very flexible and powerful tool that provides Excel- and Word-like formatting capabilities for controlling the appearance of the grid's display. When a **C1TrueDBGrid** or **C1TrueDBDropDown** control is created, it contains ten built-in styles. Modify the built-in styles or add custom styles either in the designer or in code. Both controls also support several optional events that use **Style** objects to convey formatting information on a per-cell or per-row basis. The object can be accessed as follows:

```vbnet
Me.C1TrueDBGrid1.Styles("Normal").BackColor = System.Drawing.Color.Gray
```

```csharp
this.c1TrueDBGrid1.Styles["Normal"].BackColor = System.Drawing.Color.Gray;                                   
```

### [ValueItems](/componentone/docs/win/online-truedbgrid/)

Encapsulates both the Values collection and ValueItem properties. The [ValueItems](/componentone/docs/win/online-truedbgrid/) object contains a collection and a couple of properties that can create alternate display values for database values in the grid. It can specify an allowable input value for a given [C1DataColumn](/componentone/docs/win/online-truedbgrid/) object, or it can also be used to translate raw data values into alternate text or graphics for display (for example, to display Balance Due and Paid in Full instead of the numeric data values 0 and 1). The **ValueItems** object contains display properties and a collection of ValueItem objects, the [ValueItemCollection](/componentone/docs/win/online-truedbgrid/). This object can be accessed as follows:

```vbnet
Me.C1TrueDBGrid.Columns(0).ValueItems.MaxComboItems = 5                                   
```

```csharp
this.c1TrueDBGrid.Columns[0].ValueItems.MaxComboItems = 5;                                 
```

### [ValueItem](/componentone/docs/win/online-truedbgrid/)

The [ValueItem](/componentone/docs/win/online-truedbgrid/) object consists of two properties: [DisplayValue](/componentone/docs/win/online-truedbgrid/) and [Value](/componentone/docs/win/online-truedbgrid/). The **Value** property specifies the underlying value in the database and the **DisplayValue** property specifies the value to be displayed in the grid. These objects are contained in the [ValueItemCollection](/componentone/docs/win/online-truedbgrid/) object, and can be edited in .NET's **ValueItemCollection** Editor. This editor is available in the **C1TrueDBGrid Designer** under the [ValueItems](/componentone/docs/win/online-truedbgrid/) object. For more information, see [Using the ValueItemCollection Editor](/componentone/docs/win/online-truedbgrid/design-time/collection-editors#valueitem-collection-editor).

### [VBar](/componentone/docs/win/online-truedbgrid/)

Represents the vertical scroll bar and its properties. The [VBar](/componentone/docs/win/online-truedbgrid/) object is used to specify properties of the vertical scrollbar. Through the use of the [VScrollBar](/componentone/docs/win/online-truedbgrid/) property, the developer can specify the width of the scroll bar, and whether is shows up automatically or not at all.