RemoveAt Method

BindingSource::RemoveAt Method (Int32)

 

Removes the item at the specified index in the list.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

public:
virtual void RemoveAt(
	int index
)

Parameters

index
Type: System::Int32

The zero-based index of the item to remove.

Exception Condition
ArgumentOutOfRangeException

index is less than zero or greater than the value of the Count property.

NotSupportedException

The underlying list represented by the List property is read-only or has a fixed size.

These two conditions can be tested with the IsFixedSize and IsReadOnly properties, respectively.

This method raises the ListChanged event.

The following code example demonstrates the List, RemoveAt, and Count members. To run this example, paste the code into a form that contains a BindingSource named BindingSource1, two labels named label1 and label2, and a button named button1. Associate the button1_Click method with the Click event for button1. Visual Basic users will need to add a reference to System.Data.dll.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 2.0
Return to top
Show:
© 2016 Microsoft