BindingList<T>.InsertItem(Int32, T) Method

Definition

Inserts the specified item in the list at the specified index.

C#
protected override void InsertItem(int index, T item);

Parameters

index
Int32

The zero-based index where the item is to be inserted.

item
T

The item to insert in the list.

Remarks

InsertItem performs the following operations:

  • Calls EndNew to commit any uncommitted items added through the AddingNew event.

  • Inserts the item at the specified index

  • Raises a ListChanged event of type ItemAdded indicating the index of the item that was inserted.

Applies to

Product Versions
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1