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

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

BindingManagerBase.RemoveAt メソッド

派生クラスでオーバーライドされると、基になるリストから指定されたインデックスに対応する行を削除します。

名前空間: System.Windows.Forms
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)
構文構文

Public MustOverride Sub
 RemoveAt ( _
    index As Integer _
)
Dim instance As BindingManagerBase
Dim index As Integer

instance.RemoveAt(index)

パラメータ

index

削除する行のインデックス。

例外例外
例外の種類条件

IndexOutOfRangeException

指定された index の位置に行がありません。

解説解説

RemoveAt メソッドは、基になるデータ ソースに依存して、メソッドの動作方法を決定します。サポートされているデータ ソースの一覧については、Binding クラスのトピックを参照してください。IList、IBindingList、ITypedList を実装するクラス、および IList を実装する厳密に型指定されたクラスについては、RemoveAt メソッドは、実際には基になるリストの内容を置換するのではなく行を削除します。

基になるリストに IBindingList インターフェイスが実装されている場合は、AllowRemove プロパティが true を返す必要があります。基になるリストに IList インターフェイスが実装されている場合は、IsFixedSize プロパティが false を返す必要があります。

使用例使用例
Private Sub button1_Click(sender As
 Object, e As EventArgs)
   Try
      ' Get the 'BindingManagerBase' object.
      Dim myBindingManagerBase As BindingManagerBase
 = BindingContext(myDataTable)
      ' Remove the selected row from the grid.
      myBindingManagerBase.RemoveAt(myBindingManagerBase.Position)
   Catch ex As Exception
      MessageBox.Show(ex.Source)
      MessageBox.Show(ex.Message)
   End Try
End Sub 'button1_Click

private void button1_Click(object sender, System.EventArgs
 e)
{
   try
   {
      // Get the 'BindingManagerBase' object.
      BindingManagerBase myBindingManagerBase=BindingContext[myDataTable];
      // Remove the selected row from the grid.
      myBindingManagerBase.RemoveAt(myBindingManagerBase.Position);
   }
   catch(Exception ex)
   {
      MessageBox.Show(ex.Source);
      MessageBox.Show(ex.Message);
   }
}
void button1_Click( Object^ /*sender*/, System::EventArgs^ /*e*/
 )
{
   try
   {
      // Get the 'BindingManagerBase' Object*.
      BindingManagerBase^ myBindingManagerBase = BindingContext[ myDataTable ];

      // Remove the selected row from the grid.
      myBindingManagerBase->RemoveAt( myBindingManagerBase->Position );
   }
   catch ( Exception^ ex ) 
   {
      MessageBox::Show( ex->Source );
      MessageBox::Show( ex->Message );
   }
}
private void button1_Click(Object sender, System.EventArgs
 e)
{
    try {
        // Get the 'BindingManagerBase' object.
        BindingManagerBase myBindingManagerBase = 
            get_BindingContext().get_Item(myDataTable);

        // Remove the selected row from the grid.
        myBindingManagerBase.RemoveAt(myBindingManagerBase.get_Position());
    }
    catch (System.Exception ex) {
        MessageBox.Show(ex.get_Source());
        MessageBox.Show(ex.get_Message());
    }
} //button1_Click
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



英和和英テキスト翻訳

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

辞書ショートカット

すべての辞書の索引

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

   

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



BindingManagerBase.RemoveAt メソッドのページの著作権

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

©2026 GRAS Group, Inc.RSS