IEditableCollectionViewAddNewItem.AddNewItem Method (Object)

.NET Framework (current version)
 

Adds the specified object to the collection.

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

abstract AddNewItem : 
        newItem:Object -> Object

Parameters

newItem
Type: System.Object

The object to add to the collection.

Return Value

Type: System.Object

The object that is added to the collection.

When you calling the AddNewItem method, it begins 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.

The following example calls the AddNewItem method to add an object to a collection. For the complete example, see the IEditableCollectionViewAddNewItem class.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 4.0
Return to top
Show: