TreeNodeBindingとは? わかりやすく解説

TreeNodeBinding クラス

メモ : このクラスは、.NET Framework version 2.0 で新しく追加されたものです。

データ項目と、それが TreeView コントロール内でバインドしているノードとの関係を定義します。

名前空間: System.Web.UI.WebControls
アセンブリ: System.Web (system.web.dll 内)
構文構文

Public NotInheritable Class
 TreeNodeBinding
    Implements IStateManager, ICloneable, IDataSourceViewSchemaAccessor
Dim instance As TreeNodeBinding
public sealed class TreeNodeBinding : IStateManager,
 ICloneable, IDataSourceViewSchemaAccessor
public ref class TreeNodeBinding sealed : IStateManager,
 ICloneable, IDataSourceViewSchemaAccessor
public final class TreeNodeBinding implements
 IStateManager, ICloneable, 
    IDataSourceViewSchemaAccessor
public final class TreeNodeBinding implements
 IStateManager, ICloneable, 
    IDataSourceViewSchemaAccessor
解説解説

複数の属性を持つ XML 要素などのように、各データ項目に複数のフィールドが含まれているデータ ソースに TreeView コントロールがバインドされた場合、ノードにはデータ項目の ToString メソッドから返される値が既定で表示されます。XML 要素の場合、ノードには要素名が表示されます。これはメニュー ツリーの基になる構造体を示す以外はあまり用途はありません。ノードのプロパティは、ツリー ノードのバインディングを指定して、特定のフィールドにバインドできます。TreeNodeBinding オブジェクトは、各データ項目とそのバインド先のノードとの関係を定義します。

TreeView コントロールは、その TreeNodeBinding オブジェクトを DataBindings プロパティに格納し、データ ソースにバインディングを適用して、ツリーの階層構造とデータ ソースの階層構造との間に一対一リレーションシップを作成します。データ ソース内の各データ項目について、TreeView コントロールは、対応する TreeNode オブジェクトを作成するために、データ項目と TreeNodeBinding オブジェクトとの照合を試みます。

TreeNodeBinding オブジェクトを作成する場合、バインディング基準を指定する必要があります。基準は、データ項目をノードにバインドするタイミングを示します。Depth プロパティと DataMember プロパティのいずれか、または両方を指定できます。両方のプロパティを指定すると、効率が少し向上します。ノードの深さはバインドされるノード レベルを指定します。たとえば、次の TreeNodeBinding 宣言は、データ ソースの Name フィールドと ID フィールドを、深さ 0 のすべてのノードの Text プロパティと Value プロパティにそれぞれバインドします。

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

データ メンバは、基になるデータ ソースのデータ項目の型を指定します。ただし、データ ソースによっては異なる情報を表している場合があります。階層データ ソースの各データ項目 (System.Web.UI.IHierarchyData インターフェイスで表される) は、データ項目の型を指定する IHierarchyData.Type プロパティを公開します。たとえば、XML 要素のデータ メンバは、要素名を指定します。データ ソースに複数のデータ項目の型がある場合、使用するデータ項目の型をデータ メンバが指定します。次の TreeNodeBinding 宣言は、階層構造の場所に無関係に、XmlDataSource コントロールの <Book> 要素をツリー内のすべてのノードにバインドします。

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

バインディング基準が確立されたら、バインド可能な TreeNode オブジェクトのプロパティを値にバインドできます。データ項目のフィールドまたは静的な値にバインドできます。TreeNodeBinding オブジェクトに静的な値がバインドされた場合、そのオブジェクトの適用先となるすべての TreeNode オブジェクトは、同じ値を共有します。

メモメモ

TreeNode オブジェクト内のバインドされたプロパティは、ノード内で対応するプロパティを直接設定することにより、選択してオーバーライドできます。

TreeNode オブジェクトのプロパティをデータ項目のフィールドにバインドできる、TreeNodeBinding クラスのプロパティの一覧を次の表に示します。

TreeNode オブジェクトのプロパティを静的な値にバインドできる、TreeNodeBinding クラスのプロパティの一覧を次の表に示します。

競合する TreeNodeBinding オブジェクトが定義されている場合、TreeView コントロールは次の優先順位でツリー ノードのバインディングを適用します。

  1. 深さとデータ メンバの両方を定義し照合する TreeNodeBinding オブジェクト。

  2. データ メンバだけを定義し照合する TreeNodeBinding オブジェクト。

  3. 深さだけを定義し照合する TreeNodeBinding オブジェクト。

  4. 深さもデータ メンバも定義しない TreeNodeBinding オブジェクト。この種のツリー ノード バインディングは、ツリー内のすべてのノードに適用されます。

  5. データ ソース内に一致するものがない TreeNodeBinding オブジェクト。この場合、データ項目の ToString メソッドによって返される値は、TreeNodeBinding オブジェクトが適用されるノードの Text プロパティと Value プロパティにバインドされます。

TreeNodeBinding クラスでは、FormatString プロパティを設定することにより、ノードに表示されるテキストの書式を設定することもできます。

使用例使用例

ツリー ノード バインディングの宣言の例を次の表に示します。

バインディングの例

説明

<asp:TreeNodeBinding TextField="Title" ValueField= "ID"/>

ツリー内のすべてのノードの Text プロパティと Value プロパティを、データ ソースの Title フィールドと ID フィールドにそれぞれバインドします。DataMember プロパティと Depth プロパティが設定されていないため、すべてのノードでこのツリー ノード バインディングの宣言が使用されます。

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

ツリー内のすべてのノードの Text プロパティと Value プロパティを、データ ソースの Book データ項目の Title フィールドと ID フィールドにそれぞれバインドします。

<asp:TreeNodeBinding Depth="2" TextField= "Title" ValueField= "ID"/>

ツリー内の深さが 2 のすべてのノードの Text プロパティと Value プロパティを、データ ソースのデータ項目の Title フィールドと ID フィールドにそれぞれバインドします。

<asp:TreeNodeBinding DataMember="Book" Depth= "2" TextField= "Title" ValueField= "ID" ImageUrl= "Image.jpg">

ツリー内の深さが 2 のすべてのノードの Text プロパティと Value プロパティを、データ ソースの Book データ項目の Title フィールドと ID フィールドにそれぞれバインドします。また、ノードの ImageUrl プロパティを静的な値にバインドします。

このセクションには、3 つのコード例が含まれています。TreeNodeBinding オブジェクトを宣言によって使用し、ノードとデータ項目との関係を定義する方法を最初のコード例に示します。TreeNodeBinding オブジェクトをプログラムで使用し、ノードとデータ項目との関係を定義する方法を 2 番目のコード例に示します。1 番目と 2 番目のコード例に対応したサンプル XML データを 3 番目のコード例に示します。

TreeNodeBinding オブジェクトを宣言によって使用し、ノードとデータ項目との関係を定義する方法を次のコード例に示します。この例を正常に動作させるには、このコード例の後に示すサンプル XML データを、Book.xml という名前のファイルにコピーする必要があります。

<%@ Page Language="VB" %>

<html>
  <body>
    <form 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="C#" %>

<html>
  <body>
    <form 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 オブジェクトをプログラムで使用し、ノードとデータ項目との関係を定義する方法を次のコード例に示します。この例を正常に動作させるには、次のコード例に示すサンプル XML データを、Book.xml という名前のファイルにコピーする必要があります。

<%@ Page Language="VB" %>

<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>
  <body>
    <form 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="C#" %>

<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>
  <body>
    <form 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>

前の 2 つのコード例に対応したサンプル XML データを次のコード例に示します。

<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>
継承階層継承階層
System.Object
  System.Web.UI.WebControls.TreeNodeBinding
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバの場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
TreeNodeBinding メンバ
System.Web.UI.WebControls 名前空間
TreeView
TreeNode クラス
TreeNodeBindingCollection
XmlDataSource
DataBindings
DataMember
Depth
FormatString
TreeNodeBinding.ImageUrl
ImageUrlField
ImageToolTip
ImageToolTipField
TreeNode.NavigateUrl プロパティ
TreeNodeBinding.NavigateUrl
NavigateUrlField
PopulateOnDemand
SelectAction
ShowCheckBox
Target
TreeNode.Text プロパティ
TreeNodeBinding.Text
TextField
TreeNode.ToolTip プロパティ
TreeNodeBinding.ToolTip
ToolTipField
TreeNode.Value プロパティ
TreeNodeBinding.Value
ValueField

TreeNodeBinding コンストラクタ

メモ : このコンストラクタは、.NET Framework version 2.0 で新しく追加されたものです。

TreeNodeBinding クラスの新しいインスタンスを初期化します。

名前空間: System.Web.UI.WebControls
アセンブリ: System.Web (system.web.dll 内)
構文構文

Dim instance As New TreeNodeBinding
public TreeNodeBinding ()
public:
TreeNodeBinding ()
public TreeNodeBinding ()
public function TreeNodeBinding ()
解説解説
使用例使用例

TreeNodeBinding コンストラクタを使用して、TreeNodeBinding オブジェクトを TreeView コントロールの DataBindings コレクションに動的に追加する方法を次のコード例に示します。

<%@ Page Language="VB" %>

<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>
  <body>
    <form 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="C#" %>

<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>
  <body>
    <form 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>

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
TreeNodeBinding クラス
TreeNodeBinding メンバ
System.Web.UI.WebControls 名前空間
TreeView
TreeNode クラス
TreeNodeBindingCollection

TreeNodeBinding プロパティ


パブリック プロパティパブリック プロパティ

  名前 説明
パブリック プロパティ DataMember ツリー ノード バインディングを適用するかどうかを判断するために、データ項目の IHierarchyData.Type プロパティと照合する値を取得または設定します。
パブリック プロパティ Depth TreeNodeBinding オブジェクトが適用されるノードの深さを取得または設定します。
パブリック プロパティ FormatString TreeNodeBinding オブジェクトが適用されるノードのテキストの表示形式を指定する文字列を取得または設定します。
パブリック プロパティ ImageToolTip TreeNodeBinding オブジェクトが適用されるノードの横に表示されるイメージのツールヒント テキストを取得または設定します。
パブリック プロパティ ImageToolTipField データ ソースからフィールドの名前を取得または設定し、TreeNodeBinding オブジェクトが適用される TreeNode オブジェクトの ImageToolTip プロパティにバインドします。
パブリック プロパティ ImageUrl TreeNodeBinding オブジェクトが適用されるノードの横に表示されるイメージの URL を取得または設定します。
パブリック プロパティ ImageUrlField データ ソースからフィールドの名前を取得または設定し、TreeNodeBinding オブジェクトが適用される TreeNode オブジェクトの ImageUrl プロパティにバインドします。
パブリック プロパティ NavigateUrl TreeNodeBinding オブジェクトが適用されるノードをクリックしたときにリンクする URL を取得または設定します。
パブリック プロパティ NavigateUrlField データ ソースからフィールドの名前を取得または設定し、TreeNodeBinding オブジェクトが適用される TreeNode オブジェクトの NavigateUrl プロパティにバインドします。
パブリック プロパティ PopulateOnDemand TreeNodeBinding オブジェクトが適用されるノードに動的にデータを設定するかどうかを示す値を取得または設定します。
パブリック プロパティ SelectAction TreeNodeBinding オブジェクトが適用されるノードを選択したときに発生するイベントを取得または設定します。
パブリック プロパティ ShowCheckBox TreeNodeBinding オブジェクトが適用されるノードの横にチェック ボックスを表示するかどうかを示す値を取得または設定します。
パブリック プロパティ Target TreeNodeBinding オブジェクトが適用されるノードに関連付けられている Web ページのコンテンツを表示する、対象のウィンドウまたはフレームを取得または設定します。
パブリック プロパティ TargetField データ ソースからフィールドの名前を取得または設定し、TreeNodeBinding オブジェクトが適用される TreeNode オブジェクトの Target プロパティにバインドします。
パブリック プロパティ Text TreeNodeBinding オブジェクトが適用されるノードに表示されるテキストを取得または設定します。
パブリック プロパティ TextField データ ソースからフィールドの名前を取得または設定し、TreeNodeBinding オブジェクトが適用される TreeNode オブジェクトの Text プロパティにバインドします。
パブリック プロパティ ToolTip TreeNodeBinding オブジェクトが適用されるノードのツールヒント テキストを取得または設定します。
パブリック プロパティ ToolTipField データ ソースからフィールドの名前を取得または設定し、TreeNodeBinding オブジェクトが適用される TreeNode オブジェクトの ToolTip プロパティにバインドします。
パブリック プロパティ Value TreeNodeBinding オブジェクトが適用されるノードの補足データ (ポストバック イベントの処理に使用するデータなど) を格納するために使用される、非表示の値を取得または設定します。
パブリック プロパティ ValueField データ ソースからフィールドの名前を取得または設定し、TreeNodeBinding オブジェクトが適用される TreeNode オブジェクトの Value プロパティにバインドします。
明示的インターフェイスの実装明示的インターフェイスの実装
  名前 説明
インターフェイスの明示的な実装 System.Web.UI.IDataSourceViewSchemaAccessor.DataSourceViewSchema このメンバの説明については、IDataSourceViewSchemaAccessor.DataSourceViewSchema のトピックを参照してください。
インターフェイスの明示的な実装 System.Web.UI.IStateManager.IsTrackingViewState このメンバの説明については、IStateManager.IsTrackingViewState のトピックを参照してください。
参照参照

関連項目

TreeNodeBinding クラス
System.Web.UI.WebControls 名前空間
TreeView
TreeNode クラス
TreeNodeBindingCollection
XmlDataSource
DataBindings
DataMember
Depth
FormatString
TreeNodeBinding.ImageUrl
ImageUrlField
ImageToolTip
ImageToolTipField
TreeNode.NavigateUrl プロパティ
TreeNodeBinding.NavigateUrl
NavigateUrlField
PopulateOnDemand
SelectAction
ShowCheckBox
Target
TreeNode.Text プロパティ
TreeNodeBinding.Text
TextField
TreeNode.ToolTip プロパティ
TreeNodeBinding.ToolTip
ToolTipField
TreeNode.Value プロパティ
TreeNodeBinding.Value
ValueField

TreeNodeBinding メソッド


パブリック メソッドパブリック メソッド

プロテクト メソッドプロテクト メソッド
明示的インターフェイスの実装明示的インターフェイスの実装
  名前 説明
インターフェイスの明示的な実装 System.ICloneable.Clone TreeNodeBinding オブジェクトのコピーを作成します。
インターフェイスの明示的な実装 System.Web.UI.IStateManager.LoadViewState 以前に保存したノードのビューステートを読み込みます。
インターフェイスの明示的な実装 System.Web.UI.IStateManager.SaveViewState ビューステートの変更をオブジェクトに保存します。
インターフェイスの明示的な実装 System.Web.UI.IStateManager.TrackViewState ビューステートへの変更を追跡するように TreeNode オブジェクトに指示します。
参照参照

関連項目

TreeNodeBinding クラス
System.Web.UI.WebControls 名前空間
TreeView
TreeNode クラス
TreeNodeBindingCollection
XmlDataSource
DataBindings
DataMember
Depth
FormatString
TreeNodeBinding.ImageUrl
ImageUrlField
ImageToolTip
ImageToolTipField
TreeNode.NavigateUrl プロパティ
TreeNodeBinding.NavigateUrl
NavigateUrlField
PopulateOnDemand
SelectAction
ShowCheckBox
Target
TreeNode.Text プロパティ
TreeNodeBinding.Text
TextField
TreeNode.ToolTip プロパティ
TreeNodeBinding.ToolTip
ToolTipField
TreeNode.Value プロパティ
TreeNodeBinding.Value
ValueField

TreeNodeBinding メンバ

データ項目と、それが TreeView コントロール内でバインドしているノードとの関係を定義します。

TreeNodeBinding データ型で公開されるメンバを以下の表に示します。


パブリック コンストラクタパブリック コンストラクタ
  名前 説明
パブリック メソッド TreeNodeBinding TreeNodeBinding クラスの新しいインスタンスを初期化します。
パブリック プロパティパブリック プロパティ
  名前 説明
パブリック プロパティ DataMember ツリー ノード バインディングを適用するかどうかを判断するために、データ項目の IHierarchyData.Type プロパティと照合する値を取得または設定します。
パブリック プロパティ Depth TreeNodeBinding オブジェクトが適用されるノードの深さを取得または設定します。
パブリック プロパティ FormatString TreeNodeBinding オブジェクトが適用されるノードのテキストの表示形式を指定する文字列を取得または設定します。
パブリック プロパティ ImageToolTip TreeNodeBinding オブジェクトが適用されるノードの横に表示されるイメージのツールヒント テキストを取得または設定します。
パブリック プロパティ ImageToolTipField データ ソースからフィールドの名前を取得または設定し、TreeNodeBinding オブジェクトが適用される TreeNode オブジェクトの ImageToolTip プロパティにバインドします。
パブリック プロパティ ImageUrl TreeNodeBinding オブジェクトが適用されるノードの横に表示されるイメージの URL を取得または設定します。
パブリック プロパティ ImageUrlField データ ソースからフィールドの名前を取得または設定し、TreeNodeBinding オブジェクトが適用される TreeNode オブジェクトの ImageUrl プロパティにバインドします。
パブリック プロパティ NavigateUrl TreeNodeBinding オブジェクトが適用されるノードをクリックしたときにリンクする URL を取得または設定します。
パブリック プロパティ NavigateUrlField データ ソースからフィールドの名前を取得または設定し、TreeNodeBinding オブジェクトが適用される TreeNode オブジェクトの NavigateUrl プロパティにバインドします。
パブリック プロパティ PopulateOnDemand TreeNodeBinding オブジェクトが適用されるノードに動的にデータを設定するかどうかを示す値を取得または設定します。
パブリック プロパティ SelectAction TreeNodeBinding オブジェクトが適用されるノードを選択したときに発生するイベントを取得または設定します。
パブリック プロパティ ShowCheckBox TreeNodeBinding オブジェクトが適用されるノードの横にチェック ボックスを表示するかどうかを示す値を取得または設定します。
パブリック プロパティ Target TreeNodeBinding オブジェクトが適用されるノードに関連付けられている Web ページのコンテンツを表示する、対象のウィンドウまたはフレームを取得または設定します。
パブリック プロパティ TargetField データ ソースからフィールドの名前を取得または設定し、TreeNodeBinding オブジェクトが適用される TreeNode オブジェクトの Target プロパティにバインドします。
パブリック プロパティ Text TreeNodeBinding オブジェクトが適用されるノードに表示されるテキストを取得または設定します。
パブリック プロパティ TextField データ ソースからフィールドの名前を取得または設定し、TreeNodeBinding オブジェクトが適用される TreeNode オブジェクトの Text プロパティにバインドします。
パブリック プロパティ ToolTip TreeNodeBinding オブジェクトが適用されるノードのツールヒント テキストを取得または設定します。
パブリック プロパティ ToolTipField データ ソースからフィールドの名前を取得または設定し、TreeNodeBinding オブジェクトが適用される TreeNode オブジェクトの ToolTip プロパティにバインドします。
パブリック プロパティ Value TreeNodeBinding オブジェクトが適用されるノードの補足データ (ポストバック イベントの処理に使用するデータなど) を格納するために使用される、非表示の値を取得または設定します。
パブリック プロパティ ValueField データ ソースからフィールドの名前を取得または設定し、TreeNodeBinding オブジェクトが適用される TreeNode オブジェクトの Value プロパティにバインドします。
パブリック メソッドパブリック メソッド
プロテクト メソッドプロテクト メソッド
明示的インターフェイスの実装明示的インターフェイスの実装
  名前 説明
インターフェイスの明示的な実装 System.ICloneable.Clone TreeNodeBinding オブジェクトのコピーを作成します。
インターフェイスの明示的な実装 System.Web.UI.IStateManager.LoadViewState 以前に保存したノードのビューステートを読み込みます。
インターフェイスの明示的な実装 System.Web.UI.IStateManager.SaveViewState ビューステートの変更をオブジェクトに保存します。
インターフェイスの明示的な実装 System.Web.UI.IStateManager.TrackViewState ビューステートへの変更を追跡するように TreeNode オブジェクトに指示します。
インターフェイスの明示的な実装 System.Web.UI.IDataSourceViewSchemaAccessor.DataSourceViewSchema このメンバの説明については、IDataSourceViewSchemaAccessor.DataSourceViewSchema のトピックを参照してください。
インターフェイスの明示的な実装 System.Web.UI.IStateManager.IsTrackingViewState このメンバの説明については、IStateManager.IsTrackingViewState のトピックを参照してください。
参照参照

関連項目

TreeNodeBinding クラス
System.Web.UI.WebControls 名前空間
TreeView
TreeNode クラス
TreeNodeBindingCollection
XmlDataSource
DataBindings
DataMember
Depth
FormatString
TreeNodeBinding.ImageUrl
ImageUrlField
ImageToolTip
ImageToolTipField
TreeNode.NavigateUrl プロパティ
TreeNodeBinding.NavigateUrl
NavigateUrlField
PopulateOnDemand
SelectAction
ShowCheckBox
Target
TreeNode.Text プロパティ
TreeNodeBinding.Text
TextField
TreeNode.ToolTip プロパティ
TreeNodeBinding.ToolTip
ToolTipField
TreeNode.Value プロパティ
TreeNodeBinding.Value
ValueField



英和和英テキスト翻訳

英語⇒日本語日本語⇒英語

辞書ショートカット

すべての辞書の索引

「TreeNodeBinding」の関連用語

TreeNodeBindingのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



TreeNodeBindingのページの著作権

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2026 Microsoft.All rights reserved.

©2026 GRAS Group, Inc.RSS