System.Web.UI.WebControls.TreeNodeBinding.FormatString Property

Gets or sets the string that specifies the display format for the text of a node to which the System.Web.UI.WebControls.TreeNodeBinding object is applied.

Syntax

[System.Web.UI.UrlProperty]
[System.ComponentModel.DefaultValue("")]
[System.ComponentModel.Localizable(true)]
public string FormatString { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

The TreeNodeBinding.FormatString property is used to provide a custom format for a node's text. The data format string consists of two parts, separated by a colon, in the form { A : Bxx }. For example, the formatting string {0:F2} displays a fixed-point number with two decimal places.

Note:

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.

Note:

This value can be set only to 0 because there is only one value in each node.

The character after the colon (B in the general example) specifies the display format for the value. 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.

Note:

Except for X, the format character is not case sensitive. The X format character displays the hexadecimal characters in the case that is specified.

The value after the format character (xx in the general example) specifies the number of significant digits or decimal places to display.

For more information on formatting strings, see Formatting Overview.

The value of this property is stored in view state.

The value of the TreeNodeBinding.FormatString property, when set, can be saved automatically to a resource file by using a designer tool. For more information, see System.ComponentModel.LocalizableAttribute and ASP.NET Globalization and Localization.

Requirements

Namespace: System.Web.UI.WebControls
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0