PagedCollectionView.RemoveAt Method

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Removes the item at the specified position from the collection.

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

Syntax

'Declaration
Public Sub RemoveAt ( _
    index As Integer _
)
public void RemoveAt(
    int index
)

Parameters

  • index
    Type: System.Int32
    The zero-based index of the item to remove.

Implements

IEditableCollectionView.RemoveAt(Int32)

Exceptions

Exception Condition
ArgumentOutOfRangeException

index is less than 0, or greater than or equal to the Count of items in the view.

InvalidOperationException

IsAddingNew is true.

-or- IsEditingItem is true.

-or-

CanRemove is false.

Remarks

index is relative to the collection view, not the underlying collection. For example, if the collection has 10 items and the view has a Filter so that 7 items appear, the valid values of index are 0 through 6.

Version Information

Silverlight

Supported in: 5, 4, 3

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.