ListCollectionView.AddNewItem Method (Object)

.NET Framework (current version)

Adds the specified object to the collection.

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

public object AddNewItem(
	object newItem


Type: System.Object

The object to add to the collection.

Return Value

Type: System.Object

The object that was added to the collection.

Exception Condition

An object cannot be added to the ListCollectionView by using the AddNewItem method.

Calling the AddNewItem method starts an add transaction. You should call the CommitNew or CancelNew methods to end the add transaction. A new item always appears in the collection view. Any filtering, sorting, or grouping that is applied to the view is applied to the new item when CommitNew is called.

.NET Framework
Available since 4.0
Return to top