System.Web 2.0.0.0 System.Object System.ICloneable System.Web.UI.IDataSourceViewSchemaAccessor System.Web.UI.IStateManager System.ComponentModel.DefaultProperty("TextField")

When the control is bound to a data source where each data item contains multiple fields (such as an XML element with several attributes), a node displays the value that is returned by the ToString method of the data item, by default. In the case of an XML element, the node displays the element name, which shows the underlying structure of the tree, but is not very useful otherwise. You can bind the properties of a node to a specific field by specifying tree node bindings. A object defines the relationship between each data item and the node that it is binding to.

The control stores its objects in the property and applies the bindings to the data source to create a one-to-one relationship between the tree hierarchy and the data source hierarchy. For each data item in the data source, the control attempts to match the data item to a object in order to create the corresponding object.

When creating a object, you must specify the criteria for binding. The criteria indicates when a data item should be bound to a node. You can specify the or property, or both properties. There is a slight performance gain by specifying both. A node depth specifies the node level that gets bound. For example, the following declaration binds the Name and ID fields of the data source to the and properties, respectively, of all nodes with a depth of 0:

`<asp:TreeNodeBinding Depth="0" TextField="Name" ValueField="ID">`

A data member specifies the type of the data item in the underlying data source, but can represent different information depending on the data source. Each data item in a hierarchical data source (represented by a interface) exposes a property, which specifies the type of the data item. For example, the data member for an XML element specifies the name of the element. When a data source contains multiple data item types, the data member specifies which data item type to use. The following declaration binds the <Book> elements of an control to all the nodes in the tree, regardless of the location in the hierarchy:

`<asp:TreeNodeBinding DataMember="Book" TextField="Title" ValueField= "ISBN">`

Once the binding criteria is established, you can then bind a property of a object that can be bound to a value. You can bind to a field of a data item or to a static value. When bound to a static value, all objects to which the object is applied share the same value.

You can selectively override a bound property in a object by setting the corresponding property directly in the node.

The following table lists the properties of the class that allow you to bind a property of the object to a field of a data item.

Property

Description

The field to bind to the property of a object.

The field to bind to the property of a object.

The field to bind to the property of a object.

The field to bind to the property of a object.

The field to bind to the property of a object.

The field to bind to the property of a object.

The following table lists the properties of the class that allow you to bind a property of the object to a static value.

Property

Description

The static value to bind to the property of a object.

The static value to bind to the property of a object.

The static value to bind to the property of a object.

The static value to bind to the property of a object.

The static value to bind to the property of a object.

The static value to bind to the property of a object.

The static value to bind to the property of a object.

The static value to bind to the property of a object.

The static value to bind to the property of a object.

The static value to bind to the property of a object.

If conflicting objects are defined, the control applies the tree node bindings in the following order of precedence:

The object that defines and matches both a depth and a data member.

The object that defines and matches the data member only.

The object that defines and matches the depth only.

The object that defines neither the depth nor the data member. (This type of tree node binding is applied to all nodes in the tree.)

The object that does not have a match in the data source. In this case, the value that is returned by the ToString method of the data item is then bound to the and properties of the nodes to which the object is applied.

The class also allows you to format the text that is displayed in a node by setting the property.

Defines the relationship between a data item and the node it is binding to in a control.

- Constructor

  Use the constructor to initialize a new instance of the class. It is often used when dynamically populating the collection of a control.

  Initializes a new instance of the class.

  2.0.0.0
- Property
  System.ComponentModel.DefaultValue("")
  System.String To be added.

  A data member specifies the type of the data item in the underlying data source, but can represent different information depending on the data source. Each data item in a hierarchical data source (represented by a object) exposes a property, which specifies the type of the data item. For example, the data member for an XML element specifies the name of the element. When a data source contains multiple data item types, the data member specifies which data item type to use. The following declaration binds the <Book> elements of an control to all the nodes in the tree, regardless of the location in the hierarchy:

  `<asp:TreeNodeBinding DataMember="Book" TextField="Title" ValueField= "ISBN">`

  When creating a object, you must specify the criteria for binding. The criteria indicates when a data item should be bound to a node. You can specify the or property, or both properties. There is a slight performance gain by specifying both.

  Once the binding criteria is established, you can then bind a property of a object that can be bound to a value. You can bind to a field of a data item or to a static value. When bound to a static value, all objects to which the object is applied share the same value.

  The value of this property is stored in view state.

  Gets or sets the value to match against a property for a data item to determine whether to apply the tree node binding.

  2.0.0.0
- Property
  System.ComponentModel.DefaultValue(-1)
  System.Int32 To be added.

  A node depth specifies the node level that gets bound. For example, the following declaration binds the Name and ID fields of the data source to the and properties, respectively, of all nodes with a depth of 0:

  `<asp:TreeNodeBinding Depth="0" TextField="Name" ValueField="ID">`

  When creating a object, you must specify the criteria for binding. The criteria indicates when a data item should be bound to a node. You can specify the or property, or both properties. There is a slight performance gain by specifying both.

  Once the binding criteria is established, you can then bind a property of a object that can be bound to a value. You can bind to a field of a data item or to a static value. When bound to a static value, all objects to which the object is applied share the same value.

  The value of this property is stored in view state.

  Gets or sets the node depth at which the object is applied.

  2.0.0.0
- Property
  System.Web.UI.UrlProperty
  System.ComponentModel.DefaultValue("")
  System.ComponentModel.Localizable(true)
  System.String To be added.

  The 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 { : }. For example, the formatting string {0:F2} displays 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 ( 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 node.

  The character after the colon ( in the general example) specifies the display format for the value. The following table lists the common formats.

  Format character

  Displays numeric values in

  C

  Currency format.

  D

  Decimal format.

  E

  Scientific (exponential) format.

  F

  Fixed format.

  G

  General format.

  N

  Number format.

  X

  Hexadecimal format.

  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 ( 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 property, when set, can be saved automatically to a resource file by using a designer tool. For more information, see and ASP.NET Globalization and Localization.

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

  2.0.0.0
- Property
  System.ComponentModel.DefaultValue("")
  System.ComponentModel.Localizable(true)
  System.String To be added.

  When the control is bound to a data source, use the property to specify the value to bind to the property of a object. The text that you specify provides Assistive Technology devices with a description of the image that can be used to make the control more accessible.

  This binding relationship affects all objects to which the object is applied. When an image is displayed next to a node, the ToolTip text is displayed when the mouse pointer is positioned over the image.

  You can selectively override the property by setting the property of each node directly.

  Instead of using the property to bind the same ToolTip text to each node image, you can bind the property of a object to a field of a data source by setting the property.

  The value of this property is stored in view state.

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

  Gets or sets the ToolTip text for the image that is displayed next to a node to which the object is applied.

  2.0.0.0
- Property
  System.ComponentModel.TypeConverter("System.Web.UI.Design.DataSourceViewSchemaConverter, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")
  System.ComponentModel.DefaultValue("")
  System.String To be added.

  When the control is bound to a data source, use the property to specify the field name to bind to the property of a object. The text that you specify provides Assistive Technology devices with a description of the image that can be used to make the control more accessible.

  This binding relationship affects all objects to which the object is applied. When an image is displayed next to a node, the ToolTip text is displayed when the mouse pointer is positioned over the image.

  You can selectively override the property by setting the property of each node directly.

  Instead of using the property to bind the property of a object to a field, you can set the property to a fixed value by setting the property.

  If the data source contains multiple fields, you must first set the or property, or both properties in order to bind to the appropriate field.

  The value of this property is stored in view state.

  Gets or sets the name of the field from the data source to bind to the property of a object to which the object is applied.

  2.0.0.0
- Property
  System.ComponentModel.Editor("System.Web.UI.Design.ImageUrlEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(System.Drawing.Design.UITypeEditor))
  System.Web.UI.UrlProperty
  System.ComponentModel.DefaultValue("")
  System.String To be added.

  When the control is bound to a data source, use the property to specify a custom image to bind to the property of a object. This binding relationship affects all objects to which the object is applied. The image is displayed next to a node and can be in any file format (.jpg, .gif, .bmp, and so on), as long as the client browser supports that format.

  You can override the image for an individual node by setting its property directly.

  Instead of using this property to bind the same image to each node, you can bind the property of a object to a field of a data source by setting the property.

  When displaying an image next to a node with the property, you should also consider setting the property. The ToolTip text that you specify provides Assistive Technology devices with a description of the image that can be used to make the control more accessible.

  The value of this property is stored in view state.

  Gets or sets the URL to an image that is displayed next to a node to which the object is applied.

  2.0.0.0
- Property
  System.ComponentModel.TypeConverter("System.Web.UI.Design.DataSourceViewSchemaConverter, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")
  System.ComponentModel.DefaultValue("")
  System.String To be added.

  When the control is bound to a data source, use the property to specify the name of the field to bind to the property of a object. This binding relationship affects all objects to which the object is applied. The image is displayed next to a node and can be in any file format (.jpg, .gif, .bmp, and so on), as long as the client browser supports the format.

  You can override the image for an individual node by setting its property directly.

  Instead of using this property to bind the property of a object to a field, you can set the property to a fixed value by setting the property.

  If the data source contains multiple fields, you must first set the or property, or both properties in order to bind to the appropriate field.

  When displaying an image next to a node with the property, you should also consider setting the property. The ToolTip text that you specify provides Assistive Technology devices with a description of the image that can be used to make the control more accessible.

  The value of this property is stored in view state.

  Gets or sets the name of the field from the data source to bind to the property of a object to which the object is applied.

  2.0.0.0
- Property
  System.ComponentModel.Editor("System.Web.UI.Design.UrlEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(System.Drawing.Design.UITypeEditor))
  System.Web.UI.UrlProperty
  System.ComponentModel.DefaultValue("")
  System.String To be added.

  When the control is bound to a data source, use the property to specify the URL to bind to the property of a object. This binding relationship affects all objects to which the object is applied. When this property is set, the control displays a hyperlink for the text of the node, instead of plain text. You can also optionally set the property to specify the window or frame in which to display the linked content.

  You can selectively override the property by setting the property of each node directly.

  Instead of using the property to bind the same URL to each node, you can bind the property of a object to a field of a data source by setting the property.

  The value of this property is stored in view state.

  Gets or sets the URL to link to when a node to which the object is applied is clicked.

  2.0.0.0
- Property
  System.ComponentModel.TypeConverter("System.Web.UI.Design.DataSourceViewSchemaConverter, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")
  System.ComponentModel.DefaultValue("")
  System.String To be added.

  When the control is bound to a data source, use the property to specify the field name to bind to the property of a object. This binding relationship affects all objects to which the object is applied. When the property is set, the control displays a hyperlink for the text of the node, instead of plain text. You can also optionally set the property to specify the window or frame in which to display the linked content.

  You can selectively override the property by setting the property of each node directly.

  Instead of using the property to bind the property of a object to a field, you can set the property to a fixed value by setting the property.

  If the data source contains multiple fields, you must first set the or property, or both properties in order to bind to the appropriate field.

  The value of this property is stored in view state.

  Gets or sets the name of the field from the data source to bind to the property of a object to which the object is applied.

  2.0.0.0
- Property
  System.ComponentModel.DefaultValue(false)
  System.Boolean To be added.

  Sometimes, it is not practical to statically predefine the tree structure due to data size or custom content that depends on user input. Because of this, the control supports dynamic node population. When the property is set to true, the child nodes of the node that the object is applied to gets populated at run time when the node is expanded.

  When data bindings are created by setting the of the control to true, the bindings that are created have the property set to true. Data bindings that are created declaratively have the property set to false. Using the declarative syntax allows you to control the behavior of individual data bindings.

  Unlike the property of the class, the property does not require an event-handling method to be defined for the event, if you are using a data source control, such as . Instead, the control dynamically generates an event-handling method using the properties of the objects in the collection. You can still define an event-handling method for the event; however, it will be called after the event-handling method for the control.

  Supported browsers can also take advantage of client-side node population. When enabled, this allows the control to populate a node dynamically on the client when that node is expanded, preventing the need to post back to the server. For more information on client-side node population, see .

  The value of this property is stored in view state.

  Gets or sets a value indicating whether the node to which the object is applied is populated dynamically.

  2.0.0.0
- Property
  System.ComponentModel.DefaultValue(System.Web.UI.WebControls.TreeNodeSelectAction.Select)
  System.Web.UI.WebControls.TreeNodeSelectAction To be added.

  When the control is bound to a data source, use the property to specify the value to bind to the property of a object. This binding relationship affects all objects to which the object is applied. The property is used to specify which event or events are raised when a node is selected.

  You can selectively override the property by setting the property of each node directly.

  The following table lists the available options.

  SelectAction value

  Description

  TreeNodeSelectAction.Expand

  Toggles the node between expanded and collapsed. Raises the event or the event, as appropriate.

  TreeNodeSelectAction.None

  Raises no events when a node is selected.

  TreeNodeSelectAction.Select

  Raises the event when a node is selected.

  TreeNodeSelectAction.SelectExpand

  Raises both the and events when a node is selected. Nodes are only expanded, never collapsed.

  The is not rendered for a node with its property set to TreeNodeSelectAction.None.

  The value of this property is stored in view state.

  Gets or sets the event or events to raise when a node to which the object is applied is selected.

  2.0.0.0
- Property
  System.ComponentModel.DefaultValue(false)
  System.Nullable<System.Boolean> To be added.

  To provide multinode selection support in the control, you can display check boxes next to an image in the node. When the control is bound to a data source, use the property to specify the value to bind to the property of a object. This binding relationship affects all objects to which the object is applied. The property is used to show or hide the check box for a node.

  Although the property can be used to display check boxes, it is more common to use the property of the control. However, the property affects every node type that is specified by the property; therefore, the property is often used to override that setting for a node to which the object is applied. You can selectively override the property by setting the property of each node directly.

  The value of this property is stored in view state.

  Gets or sets a value indicating whether a check box is displayed next to a node to which the object is applied.

  2.0.0.0
- Method
  2.0.0.0
  System.Object

  The method is a helper function that creates a copy of the object from which the method is called.

  the method is used primarily by control developers.

  Creates a copy of the object.

  An object that represents a copy of the object.

- Property
  2.0.0.0
  System.Object To be added.

  This member is an explicit interface member implementation. It can be used only when the instance is cast to the interface.

  The value of this property is stored in view state.

  For a description of this member, see .

- Property
  2.0.0.0
  System.Boolean To be added.

  This member is an explicit interface member implementation. It can be used only when the instance is cast to the interface.

  For a description of this member, see .

- Method
  2.0.0.0
  System.Void `` To be added. To be added.

  Loads the previously saved view state for the node.

- Method
  2.0.0.0
  System.Object To be added.

  Saves the view state changes to an object.

  The object that contains the view state changes.

- Method
  2.0.0.0
  System.Void

  After the method has been called on a server control, the property returns true.

  Instructs the object to track changes to its view state.

- Property
  System.ComponentModel.DefaultValue("")
  System.String To be added.

  When the control is bound to a data source, use the property to specify the value to bind to the property of a object. This binding relationship affects all objects to which the object is applied. The property is used to specify the window or frame in which to display the Web content that is linked to a node when that node is clicked.

  Setting the property overrides the property of the control for the nodes to which the object is applied. You can selectively override the property by setting the property of each node directly.

  The property renders as a target attribute. The target attribute on anchor elements is not allowed in the XHTML 1.1 document type definition. Do not set the property, if the rendered output for the control must be XHTML 1.1 compliant. For more information, see ASP.NET and XHTML Compliance.

  When creating accessible Web pages, you should avoid using the property to target another window. For more information, see ASP.NET Accessibility.

  The value of this property is stored in view state.

  Gets or sets the target window or frame in which to display the Web page content that is associated with a node to which the object is applied.

  2.0.0.0
- Property
  System.ComponentModel.TypeConverter("System.Web.UI.Design.DataSourceViewSchemaConverter, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")
  System.ComponentModel.DefaultValue("")
  System.String To be added.

  When the control is bound to a data source, use the property to specify the field name to bind to the property of a object. The property is used to specify the window or frame in which to display the Web content that is linked to a node when that node is clicked.

  This binding relationship affects all objects to which the object is applied.

  You can selectively override the property by setting the property of each node directly.

  Instead of using the property to bind the property of a object to a field, you can set property to a fixed value by setting the property.

  If the data source contains multiple fields, you must first set the or property, or both properties in order to bind to the appropriate field.

  The value of this property is stored in view state.

  Gets or sets the name of the field from the data source to bind to the property of a object to which the object is applied.

  2.0.0.0
- Property
  System.ComponentModel.DefaultValue("")
  System.ComponentModel.Localizable(true)
  System.String To be added.

  When the control is bound to a data source, use the property to specify the value to bind to the property of a object. This binding relationship affects all objects to which the object is applied. The property is used to specify the text displayed in a node.

  You can selectively override the property by setting the property of each node directly.

  Instead of using the property to bind the same text to each node, you can bind the property of a object to a field of a data source by setting the property.

  The value of this property is stored in view state.

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

  Gets or sets the text that is displayed for the node to which the object is applied.

  2.0.0.0
- Property
  System.ComponentModel.TypeConverter("System.Web.UI.Design.DataSourceViewSchemaConverter, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")
  System.ComponentModel.DefaultValue("")
  System.String To be added.

  When the control is bound to a data source, use the property to specify the field name to bind to the property of a object. This binding relationship affects all objects to which the object is applied. The property is used to specify the text displayed in a node.

  You can selectively override the property by setting the property of each node directly.

  Instead of using the property to bind the property of a object to a field, you can set the property to a fixed value by setting the property.

  If the data source contains multiple fields, you must first set the or property, or both properties in order to bind to the appropriate field.

  The value of this property is stored in view state.

  Gets or sets the name of the field from the data source to bind to the property of a object to which the object is applied.

  2.0.0.0
- Property
  System.ComponentModel.Localizable(true)
  System.ComponentModel.DefaultValue("")
  System.String To be added.

  When the control is bound to a data source, use the property to specify the value to bind to the property of a object. This binding relationship affects all objects to which the object is applied. The ToolTip text is displayed when the mouse pointer is positioned over the node.

  You can selectively override the property by setting the property of each node directly.

  Instead of using the property to bind the same ToolTip text to each node, you can bind the property of a object to a field of a data source by setting the property.

  The value of this property is stored in view state.

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

  Gets or sets the ToolTip text for a node to which the object is applied.

  2.0.0.0
- Property
  System.ComponentModel.TypeConverter("System.Web.UI.Design.DataSourceViewSchemaConverter, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")
  System.ComponentModel.DefaultValue("")
  System.String To be added.

  When the control is bound to a data source, use the property to specify the field name to bind to the property of a object. This binding relationship affects all objects to which the object is applied. The ToolTip text is displayed when the mouse pointer is positioned over the node.

  You can selectively override the property by setting the property of each node directly.

  Instead of using the property to bind the property of a object to a field, you can set the property to a fixed value by setting the property.

  If the data source contains multiple fields, you must first set the or property, or both properties in order to bind to the appropriate field.

  The value of this property is stored in view state.

  Gets or sets the name of the field from the data source to bind to the property of a object to which the object is applied.

  2.0.0.0
- Method
  System.String To be added.

  Returns the property.

  Returns the property. If the property is null or an empty string (""), (Empty) is returned.

  2.0.0.0
- Property
  System.ComponentModel.Localizable(true)
  System.ComponentModel.DefaultValue("")
  System.String To be added.

  When the control is bound to a data source, use the property to specify the value to bind to the property of a object. This binding relationship affects all objects to which the object is applied. The property is used to supplement the property by storing any additional data associated with the node to which the object is applied. This value is not displayed in the control and is commonly used to store data for handling postback events.

  You can selectively override the property by setting the property of each node directly.

  Instead of using the property to bind the same value to each node, you can bind the property of a object to a field of a data source by setting the property.

  The value of this property is stored in view state.

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

  Gets or sets a displayed value that is not displayed but is used to store any additional data about a node to which the object is applied, such as data used for handling postback events.

  2.0.0.0
- Property
  System.ComponentModel.TypeConverter("System.Web.UI.Design.DataSourceViewSchemaConverter, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")
  System.ComponentModel.DefaultValue("")
  System.String To be added.

  When the control is bound to a data source, use the property to specify the field name to bind to the property of a object. This binding relationship affects all objects to which the object is applied. The property is used to supplement the property by storing any additional data associated with the node to which the object is applied. This value is not displayed in the control and is commonly used to store data for handling postback events.

  You can selectively override the property by setting the property of each node directly.

  Instead of using the property to bind the property of a object to an field, you can set the property to a fixed value by setting the property.

  If the data source contains multiple fields, you must first set the or property, or both properties in order to bind to the appropriate field.

  The value of this property is stored in view state.

  Gets or sets the name of the field from the data source to bind to the property of a object to which the object is applied.

  2.0.0.0