Assembly: mscorlib (in mscorlib.dll)
Public Sub RemoveAt ( _ index As Integer _ )
Dim instance As List(Of T) Dim index As Integer instance.RemoveAt(index)
public void RemoveAt ( int index )
public: virtual void RemoveAt ( int index ) sealed
public final void RemoveAt ( int index )
public final function RemoveAt ( index : int )
Not applicable.
Parameters
- index
-
The zero-based index of the element to remove.
| Exception type | Condition |
|---|---|
| index is less than 0. -or- index is equal to or greater than Count. |
This method is an O(n) operation, where n is (Count - index).
Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1..NET Framework
Supported in: 3.0, 2.0.NET Compact Framework
Supported in: 2.0XNA Framework
Supported in: 1.0Don't know if this will be of help to anyone else, but I was updating a List(Of T) from a DataGridView. Due to constraints on the objects, I had it set up to associate the represented object as the tag of each row. Upon closing (and saving) the changes, it would scan the rows, apply the changes to the linked objects, and then create / remove additions or deletions.
I thought the List.Remove() and List.RemoveAt were misbehaving because it kept leaving behind a null value in the list after successful removal of an item. In actuality, I was just not filtering the on the Row.IsNewRow() - which meant after a clean removal, I was adding a null object to my list.