TreeNodeBindingCollection.Item プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > TreeNodeBindingCollection.Item プロパティの意味・解説 

TreeNodeBindingCollection.Item プロパティ

メモ : このプロパティは、.NET Framework version 2.0新しく追加されたものです。

TreeNodeBindingCollection オブジェクト内の指定したインデックス位置にある TreeNodeBinding オブジェクト取得または設定します

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

Public Default Property
 Item ( _
    i As Integer _
) As TreeNodeBinding
Dim instance As TreeNodeBindingCollection
Dim i As Integer
Dim value As TreeNodeBinding

value = instance(i)

instance(i) = value
public TreeNodeBinding this [
    int i
] { get; set; }
public:
property TreeNodeBinding^ default [int] {
    TreeNodeBinding^ get (int i);
    void set (int i, TreeNodeBinding^
 value);
}
/** @property */
public TreeNodeBinding get_Item (int i)

/** @property */
public void set_Item (int
 i, TreeNodeBinding value)

パラメータ

i

取得する TreeNodeBinding の、0 から始まるインデックス番号

プロパティ
TreeNodeBindingCollection 内の指定したインデックス位置にある TreeNodeBinding

解説解説
使用例使用例

Item インデクサ使用して TreeNodeBindingCollection オブジェクト内にある項目にアクセスするコード例次に示します第 3 レベルノードTreeNodeBinding オブジェクトプログラムによって新しい値に更新されます。この例を正しく実行するには、このセクション末尾にある XML データを Book.xml ファイルコピーする必要があります

<%@ Page Language="VB" %>

<script runat="server">

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

    ' Use the indexer to access the TreeNodeBinding object for
    ' the third-level nodes (index 2) and change the value of 
    ' its TextField property to "Subject".
    BookTreeView.DataBindings(2).TextField = "Subject"

  End Sub

</script>

<html>
  <body>
    <form runat="server">
    
      <h3>TreeNodeBindingCollection Indexer 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#" %>

<script runat="server">

  void Page_Load(Object sender, EventArgs e)
  {

    // Use the indexer to access the TreeNodeBinding object for
    // the third-level nodes (index 2) and change the value of 
    // its TextField property to "Subject".
    BookTreeView.DataBindings[2].TextField = "Subject";

  }

</script>

<html>
  <body>
    <form runat="server">
    
      <h3>TreeNodeBindingCollection Indexer 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>

前のコード例使用する XML データ次に示します

<Book Title="Book Title">
    <Chapter Heading="Chapter 1">
        <Section Heading="Section 1"
            Subject="Subject 1">
        </Section>
        <Section Heading="Section 2"
            Subject="Subject 1">
        </Section>
    </Chapter>
    <Chapter Heading="Chapter 2">
        <Section Heading="Section 1"
            Subject="Subject 1">
        </Section>
    </Chapter>
</Book>
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
TreeNodeBindingCollection クラス
TreeNodeBindingCollection メンバ
System.Web.UI.WebControls 名前空間
TreeView
TreeNode クラス
StateManagedCollection.GetEnumerator



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

TreeNodeBindingCollection.Item プロパティのお隣キーワード
検索ランキング

   

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



TreeNodeBindingCollection.Item プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2024 GRAS Group, Inc.RSS