InsertColumn

Description

Inserts a column with the specified label, alignment, and width at the specified location.

Applies to

ListView controls

Syntax

listviewname.InsertColumn ( index, label, alignment, width )

Argument

Description

listviewname

The name of the ListView control to which you want to insert a column.

index

An integer whose value is the number of the column before which you are inserting a new column.

label

A string whose value is the name of the column you are inserting.

alignment

A value of the enumerated datatype Alignment specifying the alignment of the column you are inserting. Values are:

  • Center!

  • Justify!

  • Left!

  • Right!

width

An integer whose value is the width of the column you are inserting, in PowerBuilder units.

Returns

Integer. Returns the column index value if it succeeds and -1 if an error occurs.

Usage

You can insert a column anywhere in the control. If the index you specify is greater than the current number of columns, the column is inserted after the last column.

Examples

Example 1

This example inserts a column named Location, makes it right-aligned, and sets the column width to 300:

lv_list.InsertColumn(2 , "Location" , Right! , 300)

See also