ListView.insertColumn

Overview | Methods | This Package | All Packages

ListView.insertColumn

Inserts a column into the list view control at the specified position and returns the column header that appears at the top of the new column.

Syntax

public ColumnHeader insertColumn( int index, ColumnHeader ch )

public ColumnHeader insertColumn( int index, String str, int width, int textAlign )

Parameters

index

The zero-based index of the new column.

ch

A ColumnHeader object representing the header for the new column.

str

The text that appears in the header for the new column.

width

The width, in pixels, of the new column.

textAlign

The text alignment setting for the new column. Possible return values are constants defined in the HorizontalAlignment class.

Return Value

Returns a ColumnHeader object representing the header for the new column.

Exceptions

WFCInvalidArgumentException thrown if the ColumnHeader object passed as the ch parameter is equal to null or if its textAlign property is not set to a valid HorizontalAlignment constant.

WFCException thrown if the column header is already contained in another list view control or there is a problem creating the new column header.

Remarks

You can either pass an existing ColumnHeader object as the ch parameter to this method or create a ColumnHeader object based on the values of the other parameters. To insert a column into the list view control to the right of existing columns, you can use the addColumn method. Columns are visible only in Report view.