System.Web.UI.WebControls.TreeView.AutoGenerateDataBindings Property

Gets or sets a value indicating whether the System.Web.UI.WebControls.TreeView control automatically generates tree node bindings.

Syntax

[System.ComponentModel.DefaultValue(true)]
public bool AutoGenerateDataBindings { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

Tree node bindings define the relationship between a data item and the node it is binding to. When binding to a data source where each data item contains multiple properties (such as an XML element with several attributes), the System.Web.UI.WebControls.TreeView control needs to know which data item property to bind to which System.Web.UI.WebControls.TreeNode property. If the TreeView.AutoGenerateDataBindings property is set to true, the System.Web.UI.WebControls.TreeView control automatically generates default tree node bindings that set the TreeNode.Text property of the System.Web.UI.WebControls.TreeNode object that is associated with the binding to the value that is returned by the ToString method of the data item.

Note:

The automatically generated tree node bindings are not added to the TreeView.DataBindings collection.

In the case of an XML element, the value that is returned by the ToString method is the element name, which shows the underlying structure of the XML file, but is not very useful otherwise. To create a more useful tree, you must define your own tree node bindings by populating the TreeView.DataBindings collection.

Note:

If you define a TreeView.DataBindings collection, the System.Web.UI.WebControls.TreeView control uses those values instead of automatically generated tree node bindings.

The value of this property is stored in view state.

Requirements

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