DataRowView.Delete DataRowView.Delete DataRowView.Delete DataRowView.Delete Method

定義

行を削除します。Deletes a row.

public:
 void Delete();
public void Delete ();
member this.Delete : unit -> unit
Public Sub Delete ()

次の例では、Deleteメソッドの行にします。The following example uses the Delete method on a row.

private void DeleteRow()
{
    DataRowView row;
    DataView view = (DataView) dataGrid1.DataSource;
    row = view[dataGrid1.CurrentCell.RowNumber];
    row.Delete();
}
Private Sub DeleteRow()
     Dim row As DataRowView
     Dim view As DataView = CType(dataGrid1.DataSource, DataView)
     row = view(dataGrid1.CurrentCell.RowNumber)
     row.Delete()
End Sub

注釈

まで、行が完全に削除されずAcceptChangesで呼び出される、DataTable行が属しています。The row is not permanently deleted until AcceptChanges is invoked on the DataTable that the row belongs to.

注意

ADataRowViewできない有効な場合に、DataRow基になるテーブルから削除されます。A DataRowView may be invalid when a DataRow is deleted from the underlying table. ときに、DataRowViewが無効に関連付けられている値にアクセスする操作DataRowViewなどDelete例外をスローします。When the DataRowView becomes invalid, operations that access values associated with DataRowView, such as Delete, throw an exception.

適用対象

こちらもご覧ください