AddColumn PowerScript function
Description
Adds a column with a specified label, alignment, and width.
Controls
ListView controls
Syntax
|
1 |
<span>listviewname.</span><span>AddColumn</span> ( <span>label, alignment, width</span> ) |
|
Argument |
Description |
|---|---|
|
listviewname |
The name of the ListView control to which |
|
label |
A string whose value is the name of the |
|
alignment |
A value of the enumerated datatype Alignment
|
|
width |
An integer whose |
Return Values
Integer. Returns the column index if
it succeeds and -1 if an error occurs.
Usage
The AddColumn function adds a column at
the end of the existing columns unlike the InsertColumn function
which inserts a column at a specified location.
Use SetItem and SetColumn to
change the values for existing items. To add new items, use AddItem.
To create columns for the report view of a ListView control, use AddColumn.
Examples
This script for a ListView event creates three columns
in a ListView control:
|
1 |
integer index |
|
1 |
|
1 |
FOR index = 3 to 25 |
|
1 |
This.AddItem ("Category " + String (index), 1 ) |
|
1 |
NEXT |
|
1 |
|
1 |
This.<span>AddColumn</span>("Name" , Left! , 1000) |
|
1 |
This.<span>AddColumn</span>("Size" , Left! , 400) |
|
1 |
This.<span>AddColumn</span>("Date" , Left! , 300) |