Share via


Column Class

Methods | This Package | All Packages

Represents a single column in a DataGrid control.

Component
  |
  +--Column

package com.ms.wfc.data.ui

public final class Column
extends
Component****

Remarks

When a DataGrid control binds to a recordset, it creates a set of Column objects, each bound to a field in the recordset. Each Column object is displayed as a column in the grid. The boundFieldName property of each column identifies the field that the column is bound to. By default, a column's header is set to the name of the bound field; however, you can change the header text by setting the column's caption property.

Initially, each field in the recordset has an associated column in the grid, and the columns are positioned according to the order of the fields in the recordset. However, you can easily add, remove, and rearrange columns in the grid, either at design time or run time. To programmatically add or remove a column, call the DataGrid control's addColumn and removeColumn methods. To rearrange columns, set the index properties of the Column objects.

A Column object displays the string representations of the values in the underlying field. To determine the actual data type of the field, call getDataType. To format column values that have a numerical, date, or boolean data type, call setDataFormat.

Column object properties are set independently of the other columns in the grid. The parent DataGrid control provides properties that first allow you to define default attributes for all columns in the grid. Using the Column object properties, you can then customize individual columns as needed. For example, set the DataGrid control's font property to define the default font for all text in the grid; then, specify a different font for one of the columns by setting the Column object's font property. The column's property setting overrides the grid's setting, for that particular column.

For information about how to access the properties of a column in the Properties window, see .