Formatting Data
When you bind data with the DataBinder control or the DataGrid control, you can format the display of numerical, date, and boolean values. Each binding managed by a DataBinder control, and each column in a DataGrid control, has a dataFormat property that allows you to specify the format.
To access the dataFormat property
If you are using a DataBinder control, expand its bindings property in the Properties window.
-or-
If you are using a DataGrid control, expand its columns property in the Properties window.
Each binding or column is listed by its index, which specifies its order within the parent control. (The index of the first binding or column is 0.)
Expand the indexed entry of the binding or column you want to format, and then click dataFormat.
To format numerical values
Set the dataFormat property to NumberDataFormat.
Expand dataFormat, and then set the format property to a numerical format string. For information about possible format strings, see the reference topic.
To format date (or time) values
Set the dataFormat property to DateDataFormat.
Expand dataFormat. To specify the date format, click the format property and select one of the following values in the drop-down list:
Note The setting of the customFormat property is applied only when the format property is set to Custom. If the format property is set to Short, Long, or Time, any setting for the customFormat property is ignored.
To format boolean values
Set the dataFormat property to BooleanDataFormat.
Expand dataFormat and set the following properties:
falseValue Specifies the string to be displayed when the value is false. The default string is False.
nullValue Specifies the string to be displayed when the value is null. The default string is (null).
trueValue Specifies the string to be displayed when the value is true. The default string is True.