GetContextService  GetFullContext

Chapter 9: Methods for the DataWindow Control

GetFormat

Description

Obtains the display format assigned to a column in a DataWindow control or DataStore object.

Syntax

string dwcontrol.GetFormat ( string column )
string dwcontrol.GetFormat ( integer 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

Returns the display format specification for column in dwcontrol. If an error occurs, GetFormat returns the empty string (""). If any argument value is NULL, the method returns NULL.

Usage

If you want to change the display format of a column temporarily, you can use GetFormat to save the current format.

Examples

Example 1

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)

See also





Copyright © 2004. Sybase Inc. All rights reserved. GetFullContext

View this book as PDF