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

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

TreeNodeBindingCollection.Remove メソッド

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

指定した TreeNodeBinding オブジェクトを TreeNodeBindingCollection オブジェクトから削除します

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

Public Sub Remove ( _
    binding As TreeNodeBinding _
)
Dim instance As TreeNodeBindingCollection
Dim binding As TreeNodeBinding

instance.Remove(binding)
public void Remove (
    TreeNodeBinding binding
)
public:
void Remove (
    TreeNodeBinding^ binding
)
public void Remove (
    TreeNodeBinding binding
)
public function Remove (
    binding : TreeNodeBinding
)

パラメータ

binding

削除する TreeNodeBinding。

解説解説
使用例使用例

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

<%@ Page Language="VB" %>

<script runat="server">

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

    ' Use the Remove method to remove the TreeNodeBinding object
    ' for the third-level nodes (index 2).
    Dim oldBinding As TreeNodeBinding = BookTreeView.DataBindings(2)
    BookTreeView.DataBindings.Remove(oldBinding)

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

    ' Use the Add method to add the TreeNodeBinding object to the 
    ' DataBindings collection.
    BookTreeView.DataBindings.Add(newBinding)

  End Sub

</script>

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

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

    // Use the Add method to add the TreeNodeBinding object to the 
    // DataBindings collection.
    BookTreeView.DataBindings.Add(newBinding);

  }

</script>

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



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

辞書ショートカット

すべての辞書の索引

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

   

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



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

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

©2024 GRAS Group, Inc.RSS