DataGridViewRowCollection.IList.Remove(Object) Method

Definition

Removes the specified DataGridViewRow from the collection.

 virtual void System.Collections.IList.Remove(System::Object ^ value) = System::Collections::IList::Remove;
void IList.Remove (object value);
void IList.Remove (object? value);
abstract member System.Collections.IList.Remove : obj -> unit
override this.System.Collections.IList.Remove : obj -> unit
Sub Remove (value As Object) Implements IList.Remove

Parameters

value
Object

The DataGridViewRow to remove from the DataGridViewRowCollection.

Implements

Exceptions

value is null.

value is not contained in this collection.

-or-

value is a shared row.

The associated DataGridView control is performing one of the following actions that temporarily prevents new rows from being added:

  • Selecting all cells in the control.

  • Clearing the selection.

-or-

This method is being called from a handler for one of the following DataGridView events:

-or-

value is the row for new records.

-or-

The associated DataGridView control is bound to an IBindingList implementation with AllowRemove and SupportsChangeNotification property values that are not both true.

Remarks

This member is an explicit interface member implementation. It can be used only when the DataGridViewRowCollection instance is cast to an IList interface.

Applies to

See also