TreeListView.InitNewNodeCommand Property
Gets or sets a command that allows you to initialize a new node with default values.
Namespace: DevExpress.Xpf.Grid
Assembly: DevExpress.Xpf.Grid.v24.2.dll
NuGet Package: DevExpress.Wpf.Grid.Core
Declaration
Property Value
Type | Description |
---|---|
ICommand<InitNewNodeArgs> | A command that allows you to initialize a new node with default values. |
Remarks
Note
We recommend that you use the AddingNewNodeCommand property instead to initialize a new node with default values.
Bind a command to the InitNewNodeCommand
property to maintain a clean MVVM pattern. The command works like an InitNewNode event handler and allows you to initialize a new node in a View Model.
The GridControl executes a command bound to the InitNewNodeCommand property in the following cases:
- A user starts to edit the New Item Row.
- A user presses the Append button in the Data Navigator.
- You call the TreeListView.AddNewNode method / TreeListViewCommands.AddNewNode command.
This command is executed after the GridControl adds a new record to your data source. Use a command bound to the InitNewNodeCommand property to initialize fields in the new record. For example, you can assign a unique value to the key field or assign default field values.
Refer to the following help topic for more information: Add and Remove Rows.