Sets the current column in a DataWindow control or DataStore.
SetColumnByColNum A separate method name is provided as an alternative syntax for the Web DataWindow server component, which cannot use overloaded methods.
DataWindow type |
Method applies to |
---|---|
PowerBuilder |
DataWindow control, DataWindowChild object, DataStore object |
Web |
Client control, PSWebDataWindowClass, server component |
Web ActiveX |
DataWindow control, DataWindowChild object |
integer dwcontrol.SetColumn ( string column)
integer dwcontrol.SetColumn ( integer column)
Web DataWindow client control, PSWebDataWindowClass, and Web ActiveX
number dwcontrol.SetColumn ( string column )
number dwcontrol.SetColumn ( number column )
Web DataWindow server component
short dwcontrol.SetColumn ( string column )
short dwcontrol.SetColumnByColNum ( short column )
Argument |
Description |
---|---|
dwcontrol |
A reference to a DataWindow control, DataStore, or child DataWindow. |
column |
The column you want to make current. Column can be a column number or a column name. |
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.
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.
PowerBuilder environment For use with PowerBuilder ListView controls, see SetColumn in the PowerScript Reference.
SetColumn can trigger these events:
ItemChanged
ItemError
ItemFocusChanged
Avoiding infinite loops 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.
This statement makes the 15th column in dw_Employee the current column:
dw_Employee.SetColumn(15)