SetColumn method (DataWindows)
Description
Sets the current column in a DataWindow control or DataStore.
A separate method name is provided as an alternative syntax
for the Web DataWindow server component, which cannot use overloaded
methods.
Controls
DataWindow type |
Method applies to |
---|---|
PowerBuilder |
DataWindow control, DataWindowChild object, DataStore |
Web |
Client control, server component |
Web ActiveX |
DataWindow control, DataWindowChild object |
Syntax
[PowerBuilder]
1 |
integer <span>dwcontrol</span>.<span>SetColumn</span> ( string <span>column</span>)<br>integer <span>dwcontrol</span>.<span>SetColumn</span> ( integer <span>column</span>) |
[Web DataWindow client control and Web ActiveX]
1 |
number <span>dwcontrol</span>.<span>SetColumn</span> ( string <span>column</span> ) <br>number <span>dwcontrol</span>.<span>SetColumn</span> ( number <span>column</span> ) |
[Web DataWindow server component]
1 |
short <span>dwcontrol</span>.<span>SetColumn</span> ( string <span>column</span> )<br>short <span>dwcontrol</span>.<span>SetColumnByColNum</span> ( short <span>column</span> ) |
Argument |
Description |
---|---|
dwcontrol |
A reference to a DataWindow control, |
column |
The column you want to make current. Column can |
Return Values
Returns 1 if it succeeds and –1 if an error occurs.
If column is less than 1 or greater than the
number of columns, SetColumn fails.
If any argument’s value is null, in PowerBuilder
and JavaScript the method returns null.
Usage
SetColumn moves the cursor to the current
column but does not scroll the DataWindow control.
Only an editable column can be current. (A column is editable
when its tab order value is greater than 0.) Do not try to set a
noneditable column as the current column.
For use with PowerBuilder ListView controls, see SetColumn in
the PowerScript Reference.
Events
SetColumn can trigger these events:
-
ItemChanged
-
ItemError
-
ItemFocusChanged
Never call SetColumn in the ItemChanged,
ItemError, or ItemFocusChanged event. Because SetColumn can
trigger these events, such a recursive call can cause a stack fault.
Examples
This statement makes the 15th column in dw_Employee
the current column:
1 |
dw_Employee.<span>SetColumn</span>(15) |