TreeNodeBinding 类

定义

定义数据项和 TreeView 控件中它所绑定到的节点之间的关系。Defines the relationship between a data item and the node it is binding to in a TreeView control.

public ref class TreeNodeBinding sealed : ICloneable, System::Web::UI::IDataSourceViewSchemaAccessor, System::Web::UI::IStateManager
public sealed class TreeNodeBinding : ICloneable, System.Web.UI.IDataSourceViewSchemaAccessor, System.Web.UI.IStateManager
type TreeNodeBinding = class
    interface IStateManager
    interface ICloneable
    interface IDataSourceViewSchemaAccessor
Public NotInheritable Class TreeNodeBinding
Implements ICloneable, IDataSourceViewSchemaAccessor, IStateManager
继承
TreeNodeBinding
实现

示例

下表显示了一些示例树节点绑定声明。The following table shows some example tree node binding declarations.

示例绑定Example binding 说明Description
<asp:TreeNodeBinding TextField="Title" ValueField= "ID"/> 将树中所有节点的 TextValue 属性分别绑定到数据源的 TitleID 字段。Binds the Text and Value properties of all nodes in the tree to the Title and ID fields of the data source, respectively. 由于未设置 DataMemberDepth 属性,所有节点都使用此树节点绑定声明。All nodes use this tree node binding declaration because the DataMember and Depth properties are not set.
<asp:TreeNodeBinding DataMember= "Book" TextField= "Title" ValueField= "ID"/> 将树中所有节点的 TextValue 属性分别绑定到数据源中 Book 数据项的 TitleID 字段。Binds the Text and Value properties of all nodes in the tree to the Title and ID fields of the Book data item in the data source, respectively.
<asp:TreeNodeBinding Depth="2" TextField= "Title" ValueField= "ID"/> 将树中深度为2的所有节点的 TextValue 属性分别绑定到数据源中数据项的 TitleID 字段。Binds the Text and Value properties of all nodes with a depth of 2 in the tree to the Title and ID fields of the data item in the data source, respectively.
<asp:TreeNodeBinding DataMember="Book" Depth= "2" TextField= "Title" ValueField= "ID" ImageUrl= "Image.jpg"> 将树中深度为2的所有节点的 TextValue 属性分别绑定到数据源中 Book 数据项的 TitleID 字段。Binds the Text and Value properties of all nodes with a depth of 2 in the tree to the Title and ID fields of the Book data item in the data source, respectively. 还将节点的 ImageUrl 属性绑定到静态值。Also binds the ImageUrl property of the nodes to a static value.

本部分包含三个代码示例。This section contains three code examples. 第一个代码示例演示如何使用 TreeNodeBinding 对象以声明方式定义节点和数据项之间的关系。The first code example demonstrates how to use TreeNodeBinding objects declaratively to define the relationship between a node and a data item. 第二个代码示例演示如何使用 TreeNodeBinding 对象以编程方式定义节点和数据项之间的关系。The second code example demonstrates how to use TreeNodeBinding objects programmatically to define the relationship between a node and a data item. 第三个代码示例提供了第一个和第二个代码示例的示例 XML 数据。The third code example provides sample XML data for the first and second code examples.

下面的代码示例演示如何使用 TreeNodeBinding 对象以声明方式定义节点和数据项之间的关系。The following code example demonstrates how to use TreeNodeBinding objects declaratively to define the relationship between a node and a data item. 若要使此示例正常工作,必须将示例 XML 数据(在此代码示例之后提供)复制到名为 books.xml 的文件中。For this example to work correctly, you must copy the sample XML data, provided after this code example, to a file named Book.xml.


<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
  <head runat="server">
    <title>TreeView XML Data Binding Example</title>
</head>
<body>
    <form id="form1" runat="server">
    
      <h3>TreeView XML Data Binding Example</h3>
    
      <asp:TreeView id="BookTreeView" 
        DataSourceID="BookXmlDataSource"
        runat="server">
         
        <DataBindings>
          <asp:TreeNodeBinding DataMember="Book" TextField="Title"/>
          <asp:TreeNodeBinding DataMember="Chapter" TextField="Heading"/>
          <asp:TreeNodeBinding DataMember="Section" TextField="Heading"/>
        </DataBindings>
         
      </asp:TreeView>

      <asp:XmlDataSource id="BookXmlDataSource"  
        DataFile="Book.xml"
        runat="server">
      </asp:XmlDataSource>
    
    </form>
  </body>
</html>


<%@ Page Language="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
  <head runat="server">
    <title>TreeView XML Data Binding Example</title>
</head>
<body>
    <form id="form1" runat="server">
    
      <h3>TreeView XML Data Binding Example</h3>
    
      <asp:TreeView id="BookTreeView" 
        DataSourceID="BookXmlDataSource"
        runat="server">
         
        <DataBindings>
          <asp:TreeNodeBinding DataMember="Book" TextField="Title"/>
          <asp:TreeNodeBinding DataMember="Chapter" TextField="Heading"/>
          <asp:TreeNodeBinding DataMember="Section" TextField="Heading"/>
        </DataBindings>
         
      </asp:TreeView>

      <asp:XmlDataSource id="BookXmlDataSource"  
        DataFile="Book.xml"
        runat="server">
      </asp:XmlDataSource>
    
    </form>
  </body>
</html>

下面的代码示例演示如何使用 TreeNodeBinding 对象以编程方式定义节点和数据项之间的关系。The following code example demonstrates how to use TreeNodeBinding objects programmatically to define the relationship between a node and a data item. 若要使此示例正常工作,必须将下一个代码示例中提供的示例 XML 数据复制到名为 books.xml 的文件中。For this example to work correctly, you must copy the sample XML data that is provided in the next code example to a file named Book.xml.


<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">

  void Page_Load(Object sender, EventArgs e)
  {

    // Create a new TreeView control.
    TreeView NewTree = new TreeView();

    // Set the properties of the TreeView control.
    NewTree.ID = "BookTreeView";
    NewTree.DataSourceID = "BookXmlDataSource";

    // Create the tree node binding relationship.

    // Create the root node binding.
    TreeNodeBinding RootBinding = new TreeNodeBinding();
    RootBinding.DataMember = "Book";
    RootBinding.TextField = "Title";

    // Create the parent node binding.
    TreeNodeBinding ParentBinding = new TreeNodeBinding();
    ParentBinding.DataMember = "Chapter";
    ParentBinding.TextField = "Heading";

    // Create the leaf node binding.
    TreeNodeBinding LeafBinding = new TreeNodeBinding();
    LeafBinding.DataMember = "Section";
    LeafBinding.TextField = "Heading";

    // Add bindings to the DataBindings collection.
    NewTree.DataBindings.Add(RootBinding);
    NewTree.DataBindings.Add(ParentBinding); 
    NewTree.DataBindings.Add(LeafBinding);

    // Manually register the event handler for the SelectedNodeChanged event.
    NewTree.SelectedNodeChanged += new EventHandler(this.Node_Change);

    // Add the TreeView control to the Controls collection of the PlaceHolder control.
    ControlPlaceHolder.Controls.Add(NewTree);

  }

  void Node_Change(Object sender, EventArgs e)
  {

    // Retrieve the TreeView control from the Controls collection of the PlaceHolder control.
    TreeView LocalTree = (TreeView)ControlPlaceHolder.FindControl("BookTreeView");

    // Display the selected node.
    Message.Text = "You selected: " + LocalTree.SelectedNode.Text;

  }

</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
  <head runat="server">
    <title>TreeView Constructor Example</title>
</head>
<body>
    <form id="form1" runat="server">
    
      <h3>TreeView Constructor Example</h3>
      
      <asp:PlaceHolder id="ControlPlaceHolder" runat="server">
      </asp:PlaceHolder>
   
      <asp:XmlDataSource id="BookXmlDataSource"  
        DataFile="Book.xml"
        runat="server">
      </asp:XmlDataSource>
      
      <br /><br />
      
      <asp:Label id="Message" runat="server"/>
    
    </form>
  </body>
</html>


<%@ Page Language="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">

  Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)

    ' Create a new TreeView control.
    Dim NewTree As New TreeView

    ' Set the properties of the TreeView control.
    NewTree.ID = "BookTreeView"
    NewTree.DataSourceID = "BookXmlDataSource"

    ' Create the tree node binding relationship.

    ' Create the root node binding.
    Dim RootBinding As New TreeNodeBinding
    RootBinding.DataMember = "Book"
    RootBinding.TextField = "Title"

    ' Create the parent node binding.
    Dim ParentBinding As New TreeNodeBinding
    ParentBinding.DataMember = "Chapter"
    ParentBinding.TextField = "Heading"

    ' Create the leaf node binding.
    Dim LeafBinding As New TreeNodeBinding
    LeafBinding.DataMember = "Section"
    LeafBinding.TextField = "Heading"

    ' Add bindings to the DataBindings collection.
    NewTree.DataBindings.Add(RootBinding)
    NewTree.DataBindings.Add(ParentBinding)
    NewTree.DataBindings.Add(LeafBinding)

    ' Manually register the event handler for the SelectedNodeChanged event.
    AddHandler NewTree.SelectedNodeChanged, AddressOf Node_Change

    ' Add the TreeView control to the Controls collection of the PlaceHolder control.
    ControlPlaceHolder.Controls.Add(NewTree)

  End Sub

  Sub Node_Change(ByVal sender As Object, ByVal e As EventArgs)

    ' Retrieve the TreeView control from the Controls collection of the PlaceHolder control.
    Dim LocalTree As TreeView = CType(ControlPlaceHolder.FindControl("BookTreeView"), TreeView)

    ' Display the selected node.
    Message.Text = "You selected: " & LocalTree.SelectedNode.Text

  End Sub

</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
  <head runat="server">
    <title>TreeView Constructor Example</title>
</head>
<body>
    <form id="form1" runat="server">
    
      <h3>TreeView Constructor Example</h3>
      
      <asp:PlaceHolder id="ControlPlaceHolder" runat="server">
      </asp:PlaceHolder>
   
      <asp:XmlDataSource id="BookXmlDataSource"  
        DataFile="Book.xml"
        runat="server">
      </asp:XmlDataSource>
      
      <br /><br />
      
      <asp:Label id="Message" runat="server"/>
    
    </form>
  </body>
</html>

下面的代码示例提供了前面的代码示例的示例 XML 数据。The following code example provides sample XML data for the preceding code examples.

<Book Title="Book Title">  
    <Chapter Heading="Chapter 1">  
        <Section Heading="Section 1">  
        </Section>  
        <Section Heading="Section 2">  
        </Section>  
    </Chapter>  
    <Chapter Heading="Chapter 2">  
        <Section Heading="Section 1">  
        </Section>  
    </Chapter>  
</Book>  

注解

如果 TreeView 控件绑定到数据源,其中每个数据项都包含多个字段(如具有多个属性的 XML 元素),则默认情况下,节点将显示数据项的 ToString 方法返回的值。When the TreeView 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. 对于 XML 元素,该节点将显示元素名称,该名称显示树的基础结构,但在其他情况下不起作用。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. TreeNodeBinding 对象定义每个数据项和它所绑定到的节点之间的关系。A TreeNodeBinding object defines the relationship between each data item and the node that it is binding to.

TreeView 控件将其 TreeNodeBinding 对象存储在 DataBindings 属性中,并将绑定应用于数据源,以在树层次结构和数据源层次结构之间创建一对一关系。The TreeView control stores its TreeNodeBinding objects in the DataBindings 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. 对于数据源中的每个数据项,TreeView 控件尝试将数据项与 TreeNodeBinding 对象匹配,以便创建相应的 TreeNode 对象。For each data item in the data source, the TreeView control attempts to match the data item to a TreeNodeBinding object in order to create the corresponding TreeNode object.

创建 TreeNodeBinding 对象时,必须指定绑定的条件。When creating a TreeNodeBinding object, you must specify the criteria for binding. 条件指示数据项应绑定到节点的时间。The criteria indicates when a data item should be bound to a node. 您可以指定 DepthDataMember 属性,或同时指定这两个属性。You can specify the Depth or DataMember property, or both properties. 通过同时指定这两个方法,可以稍微提高性能。There is a slight performance gain by specifying both. 节点深度指定要绑定的节点级别。A node depth specifies the node level that gets bound. 例如,以下 TreeNodeBinding 声明将数据源的 NameID 字段分别绑定到深度为0的所有节点的 TextValue 属性:For example, the following TreeNodeBinding declaration binds the Name and ID fields of the data source to the Text and Value 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. 分层数据源(由 System.Web.UI.IHierarchyData 接口表示)中的每个数据项都公开了 IHierarchyData.Type 属性,该属性指定数据项的类型。Each data item in a hierarchical data source (represented by a System.Web.UI.IHierarchyData interface) exposes a IHierarchyData.Type property, which specifies the type of the data item. 例如,XML 元素的数据成员指定元素的名称。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. 以下 TreeNodeBinding 声明将 XmlDataSource 控件的 <Book> 元素绑定到树中的所有节点,而与层次结构中的位置无关:The following TreeNodeBinding declaration binds the <Book> elements of an XmlDataSource control to all the nodes in the tree, regardless of the location in the hierarchy:

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

建立绑定条件后,可以绑定可以绑定到值的 TreeNode 对象的属性。Once the binding criteria is established, you can then bind a property of a TreeNode object that can be bound to a value. 您可以绑定到数据项或静态值的字段。You can bind to a field of a data item or to a static value. 绑定到静态值时,将应用 TreeNodeBinding 对象的所有 TreeNode 对象共享相同的值。When bound to a static value, all TreeNode objects to which the TreeNodeBinding object is applied share the same value.

备注

通过直接在节点中设置相应的属性,可以有选择地覆盖 TreeNode 对象中的绑定属性。You can selectively override a bound property in a TreeNode object by setting the corresponding property directly in the node.

下表列出了 TreeNodeBinding 类的属性,该属性允许你将 TreeNode 对象的属性绑定到数据项的字段。The following table lists the properties of the TreeNodeBinding class that allow you to bind a property of the TreeNode object to a field of a data item.

属性Property 说明Description
ImageUrlField 要绑定到 TreeNode 对象的 ImageUrl 属性的字段。The field to bind to the ImageUrl property of a TreeNode object.
ImageToolTipField 要绑定到 TreeNode 对象的 ImageToolTip 属性的字段。The field to bind to the ImageToolTip property of a TreeNode object.
NavigateUrlField 要绑定到 TreeNode 对象的 NavigateUrl 属性的字段。The field to bind to the NavigateUrl property of a TreeNode object.
TextField 要绑定到 TreeNode 对象的 Text 属性的字段。The field to bind to the Text property of a TreeNode object.
ToolTipField 要绑定到 TreeNode 对象的 ToolTip 属性的字段。The field to bind to the ToolTip property of a TreeNode object.
ValueField 要绑定到 TreeNode 对象的 Value 属性的字段。The field to bind to the Value property of a TreeNode object.

下表列出了 TreeNodeBinding 类的属性,该属性允许你将 TreeNode 对象的属性绑定到静态值。The following table lists the properties of the TreeNodeBinding class that allow you to bind a property of the TreeNode object to a static value.

属性Property 说明Description
ImageUrl 要绑定到 TreeNode 对象的 ImageUrl 属性的静态值。The static value to bind to the ImageUrl property of a TreeNode object.
ImageToolTip 要绑定到 TreeNode 对象的 ImageToolTip 属性的静态值。The static value to bind to the ImageToolTip property of a TreeNode object.
NavigateUrl 要绑定到 TreeNode 对象的 NavigateUrl 属性的静态值。The static value to bind to the NavigateUrl property of a TreeNode object.
PopulateOnDemand 要绑定到 TreeNode 对象的 PopulateOnDemand 属性的静态值。The static value to bind to the PopulateOnDemand property of a TreeNode object.
SelectAction 要绑定到 TreeNode 对象的 SelectAction 属性的静态值。The static value to bind to the SelectAction property of a TreeNode object.
ShowCheckBox 要绑定到 TreeNode 对象的 ShowCheckBox 属性的静态值。The static value to bind to the ShowCheckBox property of a TreeNode object.
Target 要绑定到 TreeNode 对象的 Target 属性的静态值。The static value to bind to the Target property of a TreeNode object.
Text 要绑定到 TreeNode 对象的 Text 属性的静态值。The static value to bind to the Text property of a TreeNode object.
ToolTip 要绑定到 TreeNode 对象的 ToolTip 属性的静态值。The static value to bind to the ToolTip property of a TreeNode object.
Value 要绑定到 TreeNode 对象的 Value 属性的静态值。The static value to bind to the Value property of a TreeNode object.

如果定义了冲突 TreeNodeBinding 的对象,则 TreeView 控件会按以下优先级顺序应用树节点绑定:If conflicting TreeNodeBinding objects are defined, the TreeView control applies the tree node bindings in the following order of precedence:

  1. 定义和匹配深度和数据成员的 TreeNodeBinding 对象。The TreeNodeBinding object that defines and matches both a depth and a data member.

  2. 仅定义和匹配数据成员的 TreeNodeBinding 对象。The TreeNodeBinding object that defines and matches the data member only.

  3. 仅定义和匹配深度的 TreeNodeBinding 对象。The TreeNodeBinding object that defines and matches the depth only.

  4. 不定义深度和数据成员的 TreeNodeBinding 对象。The TreeNodeBinding object that defines neither the depth nor the data member. (此类型的树节点绑定适用于树中的所有节点。)(This type of tree node binding is applied to all nodes in the tree.)

  5. 数据源中没有匹配项的 TreeNodeBinding 对象。The TreeNodeBinding object that does not have a match in the data source. 在这种情况下,数据项 ToString 方法返回的值将绑定到 TreeNodeBinding 对象应用到的节点的 TextValue 属性。In this case, the value that is returned by the ToString method of the data item is then bound to the Text and Value properties of the nodes to which the TreeNodeBinding object is applied.

使用 TreeNodeBinding 类,还可以通过设置 FormatString 属性设置节点中显示的文本的格式。The TreeNodeBinding class also allows you to format the text that is displayed in a node by setting the FormatString property.

构造函数

TreeNodeBinding()

初始化 TreeNodeBinding 类的新实例。Initializes a new instance of the TreeNodeBinding class.

属性

DataMember

获取或设置与数据项的 Type 属性进行匹配以确定是否应用树节点绑定的值。Gets or sets the value to match against a Type property for a data item to determine whether to apply the tree node binding.

Depth

获取或设置应用 TreeNodeBinding 对象的节点深度。Gets or sets the node depth at which the TreeNodeBinding object is applied.

FormatString

获取或设置字符串,指定 TreeNodeBinding 对象应用到的节点的文本显示格式。Gets or sets the string that specifies the display format for the text of a node to which the TreeNodeBinding object is applied.

ImageToolTip

获取或设置显示在 TreeNodeBinding 对象应用到的节点旁边的图像的 ToolTip 文本。Gets or sets the ToolTip text for the image that is displayed next to a node to which the TreeNodeBinding object is applied.

ImageToolTipField

获取或设置数据源中字段的名称,该字段将绑定到 ImageToolTip 对象将应用到的 TreeNode 对象的 TreeNodeBinding 属性。Gets or sets the name of the field from the data source to bind to the ImageToolTip property of a TreeNode object to which the TreeNodeBinding object is applied.

ImageUrl

获取或设置显示在应用 TreeNodeBinding 对象的节点旁边的图像的 URL。Gets or sets the URL to an image that is displayed next to a node to which the TreeNodeBinding object is applied.

ImageUrlField

获取或设置数据源中字段的名称,该字段将绑定到 ImageUrl 对象将应用到的 TreeNode 对象的 TreeNodeBinding 属性。Gets or sets the name of the field from the data source to bind to the ImageUrl property of a TreeNode object to which the TreeNodeBinding object is applied.

NavigateUrl

获取或设置单击 TreeNodeBinding 对象应用到的节点时链接到的 URL。Gets or sets the URL to link to when a node to which the TreeNodeBinding object is applied is clicked.

NavigateUrlField

获取或设置数据源中字段的名称,该字段将绑定到 NavigateUrl 对象将应用到的 TreeNode 对象的 TreeNodeBinding 属性。Gets or sets the name of the field from the data source to bind to the NavigateUrl property of a TreeNode object to which the TreeNodeBinding object is applied.

PopulateOnDemand

获取或设置一个值,指示是否动态填充 TreeNodeBinding 对象应用到的节点。Gets or sets a value indicating whether the node to which the TreeNodeBinding object is applied is populated dynamically.

SelectAction

获取或设置当选定 TreeNodeBinding 对象应用到的节点时引发的事件。Gets or sets the event or events to raise when a node to which the TreeNodeBinding object is applied is selected.

ShowCheckBox

获取或设置一个值,指示是否在 TreeNodeBinding 对象应用到的节点旁边显示复选框。Gets or sets a value indicating whether a check box is displayed next to a node to which the TreeNodeBinding object is applied.

Target

获取或设置在其中显示与 TreeNodeBinding 对象应用到的节点关联的网页内容的目标窗口或框架。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 TreeNodeBinding object is applied.

TargetField

获取或设置数据源中字段的名称,该字段将绑定到 Target 对象将应用到的 TreeNode 对象的 TreeNodeBinding 属性。Gets or sets the name of the field from the data source to bind to the Target property of a TreeNode object to which the TreeNodeBinding object is applied.

Text

获取或设置为 TreeNodeBinding 对象应用到的节点显示的文本。Gets or sets the text that is displayed for the node to which the TreeNodeBinding object is applied.

TextField

获取或设置数据源中字段的名称,该字段将绑定到 Text 对象将应用到的 TreeNode 对象的 TreeNodeBinding 属性。Gets or sets the name of the field from the data source to bind to the Text property of a TreeNode object to which the TreeNodeBinding object is applied.

ToolTip

获取或设置 TreeNodeBinding 对象应用到的节点的 ToolTip 文本。Gets or sets the ToolTip text for a node to which the TreeNodeBinding object is applied.

ToolTipField

获取或设置数据源中字段的名称,该字段将绑定到 ToolTip 对象将应用到的 TreeNode 对象的 TreeNodeBinding 属性。Gets or sets the name of the field from the data source to bind to the ToolTip property of a TreeNode object to which the TreeNodeBinding object is applied.

Value

获取或设置显示值,该值是不显示的,但用来存储有关 TreeNodeBinding 对象应用到的节点的任何其他数据,如用于处理回发事件的数据。Gets or sets a displayed value that is not displayed but is used to store any additional data about a node to which the TreeNodeBinding object is applied, such as data used for handling postback events.

ValueField

获取或设置数据源中字段的名称,该字段将绑定到 Value 对象将应用到的 TreeNode 对象的 TreeNodeBinding 属性。Gets or sets the name of the field from the data source to bind to the Value property of a TreeNode object to which the TreeNodeBinding object is applied.

方法

Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
GetHashCode()

用作默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
ToString()

返回 DataMember 属性。Returns the DataMember property.

显式接口实现

ICloneable.Clone()

创建 TreeNodeBinding 对象的副本。Creates a copy of the TreeNodeBinding object.

IDataSourceViewSchemaAccessor.DataSourceViewSchema

有关此成员的说明,请参见 DataSourceViewSchemaFor a description of this member, see DataSourceViewSchema.

IStateManager.IsTrackingViewState

有关此成员的说明,请参见 IsTrackingViewStateFor a description of this member, see IsTrackingViewState.

IStateManager.LoadViewState(Object)

加载以前保存的节点的视图状态。Loads the previously saved view state for the node.

IStateManager.SaveViewState()

保存对象的视图状态更改。Saves the view state changes to an object.

IStateManager.TrackViewState()

指示 TreeNode 对象跟踪对其视图状态的更改。Instructs the TreeNode object to track changes to its view state.

适用于

另请参阅