wpf-devexpress-dot-xpf-dot-grid-dot-datacontrolbase-b275913b.md
Gets the handle of the New Item Row.
Namespace : DevExpress.Xpf.Grid
Assembly : DevExpress.Xpf.Grid.v25.2.Core.dll
NuGet Package : DevExpress.Wpf.Grid.Core
public const int NewItemRowHandle = -2147483647
Public Const NewItemRowHandle As Integer = -2147483647
| Type | Description |
|---|---|
| Int32 |
The handle of the New Item Row.
|
Tip
Topic : Obtaining Row Handles
The following code snippets (auto-collected from DevExpress Examples) contain references to the NewItemRowHandle field.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
void OnValidateRow(object sender, GridRowValidationEventArgs e) {
if(e.RowHandle == GridControl.NewItemRowHandle) {
e.IsValid = !string.IsNullOrEmpty(((Product)e.Row).ProductName);
wpf-data-grid-specify-edit-form-settings/CS/DefineEditFormSettings_CodeBehind/MainWindow.xaml.cs#L49
private void OnRowEditStarting(object sender, RowEditStartingEventArgs e) {
if(Equals(e.RowHandle, DataControlBase.NewItemRowHandle)) {
e.CellEditors[0].Value = grid.VisibleRowCount + 1;
wpf-data-grid-extend-crud-operations/CS/Undo/UndoCRUDOperationsBehavior.cs#L92
void OnEditingStarted(object sender, RowEditStartedEventArgs e) {
if(e.RowHandle != DataControlBase.NewItemRowHandle) {
editingCache = CopyOperationsSupporter.Clone(e.Row);
Private Sub OnValidateRow(ByVal sender As Object, ByVal e As GridRowValidationEventArgs)
If e.RowHandle = DataControlBase.NewItemRowHandle Then
e.IsValid = Not String.IsNullOrEmpty(CType(e.Row, Product).ProductName)
wpf-data-grid-specify-edit-form-settings/VB/DefineEditFormSettings_CodeBehind/MainWindow.xaml.vb#L92
Private Sub OnRowEditStarting(ByVal sender As Object, ByVal e As RowEditStartingEventArgs)
If Equals(e.RowHandle, DataControlBase.NewItemRowHandle) Then
e.CellEditors(0).Value = Me.grid.VisibleRowCount + 1
wpf-data-grid-extend-crud-operations/VB/Undo/UndoCRUDOperationsBehavior.vb#L121
Private Sub OnEditingStarted(ByVal sender As Object, ByVal e As RowEditStartedEventArgs)
If e.RowHandle <> DataControlBase.NewItemRowHandle Then
editingCache = CopyOperationsSupporter.Clone(e.Row)
See Also