TreeNodeBindingCollection.RemoveAt メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > TreeNodeBindingCollection.RemoveAt メソッドの意味・解説 

TreeNodeBindingCollection.RemoveAt メソッド

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

指定したインデックス位置にある TreeNodeBinding オブジェクトを TreeNodeBindingCollection オブジェクトから削除します

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

Public Sub RemoveAt ( _
    index As Integer _
)
Dim instance As TreeNodeBindingCollection
Dim index As Integer

instance.RemoveAt(index)
public void RemoveAt (
    int index
)
public:
void RemoveAt (
    int index
)
public void RemoveAt (
    int index
)

パラメータ

index

削除する TreeNodeBinding の、0 から始まるインデックス位置

解説解説
使用例使用例

RemoveAt メソッド使用してTreeNodeBindingCollection オブジェクトから TreeNodeBinding オブジェクトプログラムによって削除するコード例次に示します。この例を正しく実行するには、このセクション末尾にある XML データを Book.xml ファイルコピーする必要があります

<%@ Page Language="vb" %>

<script runat="server">

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

        ' Use the RemoveAt method to remove the TreeNodeBinding object
        ' for the third-level nodes (index 2).
        BookTreeView.DataBindings.RemoveAt(2)

        ' Create a new TreeNodeBinding object and set its properties.
        Dim newBinding As TreeNodeBinding =
 New TreeNodeBinding
        newBinding.DataMember = "Section"
        newBinding.TextField = "Subject"

        ' Use the Insert method to insert the TreeNodeBinding object
 to
        ' the DataBindings collection at index 2.
        BookTreeView.DataBindings.Insert(2, newBinding)

    End Sub

</script>

<html>
    <body>
        <form runat="server">
        
            <h3>TreeNodeBindingCollection Insert and RemoveAt
 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 RemoveAt method to remove the TreeNodeBinding object
 
    // for the third-level nodes (index 2).
    BookTreeView.DataBindings.RemoveAt(2);

    // Create a new TreeNodeBinding object and set its properties.
    TreeNodeBinding newBinding = new TreeNodeBinding();
    newBinding.DataMember = "Section";
    newBinding.TextField = "Subject";

    // Use the Insert method to insert the TreeNodeBinding object 
    // into the DaaBindings collection at index 2.
    BookTreeView.DataBindings.Insert(2, newBinding);

  }

</script>

<html>
  <body>
    <form runat="server">
    
      <h3>TreeNodeBindingCollection Insert and RemoveAt 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 クラス
DataBindings
Add
Insert
Remove



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

辞書ショートカット

すべての辞書の索引

TreeNodeBindingCollection.RemoveAt メソッドのお隣キーワード
検索ランキング

   

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



TreeNodeBindingCollection.RemoveAt メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2024 GRAS Group, Inc.RSS