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
-or-
If you are using a DataGrid control, expand its columns property in the Properties window.
To format numerical values
To format date (or time) values
Format | Description |
Long | The dates are formatted using the Long Date setting in the Regional Settings section of the Windows Control Panel. (The default setting for a long date appears as Monday, March 9, 1998.) |
Short | (Default) The dates are formatted using the Short Date setting in the Regional Settings section of the Windows Control Panel. (The default setting for a short date appears as 3/9/98.) |
Time | The times are formatted using the Long Time setting in the Regional Settings section of the Windows Control Panel. (The default setting for a long time appears as 2:45:05 PM.) |
Custom | The dates or times are formatted using a custom format. Set the customFormat property to the custom format string. For information about possible format strings, see the DateDataFormat.setCustomFormat reference topic. |
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