SortableBindingListTInsertItem Method

Inserts an element into the SortableBindingListT at the specified index.

Definition

Namespace: KGySoft.ComponentModel
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 9.0.0
C#
protected override void InsertItem(
	int index,
	T item
)

Parameters

index  Int32
The zero-based index at which item should be inserted.
item  T
The object to insert.

Remarks

InsertItem performs the following operations:

  1. Calls EndNew to commit the last possible uncommitted item added by the AddNew method.
  2. Inserts the item at the specified index.
  3. Raises a ListChanged event of type ItemChanged indicating the index of the item that was inserted.
  4. If both IsSorted and SortOnChange properties are and the position of the new item would break the sort order, then a new sort is immediately applied, which raises a ListChanged event of type Reset.

See Also