AddNew Method
See Also 
Xceed.Wpf.DataGrid Assembly > Xceed.Wpf.DataGrid Namespace > DataGridCollectionView Class : AddNew Method

Adds a new item to the underlying data source.

Syntax

Visual Basic (Declaration) 
Public Function AddNew() As Object
C# 
public object AddNew()

Return Value

A reference to the item that was added to the list.

Exceptions

ExceptionDescription
System.InvalidCastExceptionWhen manually handling the item-insertion process the CreatingNewItem, CommittingNewItem, and CancelingNewItem events must all be handled.

Remarks

The new item will be committed to the underlying data source only when one of the following conditions is met:

  1. The EndNew method is called.
  2. An operation that changes the contents of the underlying data source, such as insertion or removal, is executed. 

If the CancelNew method is called, the item will not be committed.

Requirements

Supported Frameworks: Microsoft .NET Framework version 3.5

See Also