| 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.| Exception | Description |
|---|---|
| System.InvalidCastException | When manually handling the item-insertion process the CreatingNewItem, CommittingNewItem, and CancelingNewItem events must all be handled. |
The new item will be committed to the underlying data source only when one of the following conditions is met:
- The EndNew method is called.
- 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.
Supported Frameworks: Microsoft .NET Framework version 3.5
Reference
DataGridCollectionView ClassDataGridCollectionView Members
Methods
EndNew MethodCancelNew Method