BindingList<T>::SetItem Method (Int32, T)

 

Replaces the item at the specified index with the specified item.

Namespace:   System.ComponentModel
Assembly:  System (in System.dll)

protected:
virtual void SetItem(
	int index,
	T item
) override

Parameters

index
Type: System::Int32

The zero-based index of the item to replace.

item
Type: T

The new value for the item at the specified index. The value can be null for reference types.

Exception Condition
ArgumentOutOfRangeException

index is less than zero.

-or-

index is greater than Count.

After the item is set, SetItem raises a ListChanged event of type ItemChanged indicating the index of the item that was set.

.NET Framework
Available since 2.0
Return to top
Show: