Obtains the display format assigned to a column in a DataWindow control or DataStore object.
Separate method name for the Web DataWindow server component A separate method, GetFormatByColNum, 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 |
Server component |
Web ActiveX |
DataWindow control, DataWindowChild object |
string dwcontrol.GetFormat ( string column ) string dwcontrol.GetFormat ( integer column )
Web DataWindow server component
string dwcontrol.GetFormat ( string column ) string dwcontrol.GetFormatByColNum ( short column )
string dwcontrol.GetFormat ( string column ) string dwcontrol.GetFormat ( number column )
Argument |
Description |
---|---|
dwcontrol |
A reference to a DataWindow control, DataStore, or child DataWindow. |
column |
The column for which you want the display format. Column can be a column number (integer) or a column name (string). |
Returns the display format specification for column in dwcontrol. If an error occurs, GetFormat returns the empty string (“ ”).
If any argument value is null, in PowerBuilder and JavaScript the method returns null.
If you want to change the display format of a column temporarily, you can use GetFormat to save the current format.
These statements save the format of column salary of dw_employee before changing it to a new format:
string OldFormat, NewFormat = "$##,###.00"
OldFormat = dw_employee.GetFormat("salary")
dw_employee.SetFormat("salary", NewFormat)