Documentation for this section has not yet been entered.
Use the ButtonColumn.DataTextFormatString property to provide a custom display format for the caption of the buttons in the System.Web.UI.WebControls.ButtonColumn object.
The data format string consists of two parts, separated by a colon, in the form {A:Bxx}. For example, the formatting string {0:F2} formats the cell to display a fixed point number with two decimal places.
The entire string must be enclosed in braces to indicate that it is a format string and not a literal string. Any text outside the braces is displayed as literal text.
The value before the colon (A in the general example) specifies the parameter index in a zero-based list of parameters.
This value can be set only to 0 because there is only one value in each cell.
The character after the colon (B in the general example) specifies the format to display the value in. The following table lists the common formats.
C |
Currency format. |
D |
Decimal format. |
E |
Scientific (exponential) format. |
F |
Fixed format. |
G |
General format. |
N |
Number format. |
X |
Hexadecimal format. |
The format character is not case sensitive, except for X, which displays the hexadecimal characters in the case specified.
The value after the format character (xx in the general example) specifies the number of significant digits or decimal places to display.
The value of this property is stored in view state.
For more information on formatting strings, see Formatting Overview.