Back to Devexpress

GridRowValidationEventArgs.IsNewItem Property

wpf-devexpress-dot-xpf-dot-grid-dot-gridrowvalidationeventargs-f5ea845f.md

latest3.1 KB
Original Source

GridRowValidationEventArgs.IsNewItem Property

Namespace : DevExpress.Xpf.Grid

Assembly : DevExpress.Xpf.Grid.v25.2.Core.dll

NuGet Package : DevExpress.Wpf.Grid.Core

Declaration

csharp
public bool IsNewItem { get; }
vb
Public ReadOnly Property IsNewItem As Boolean

Property Value

Type
Boolean

The following code snippets (auto-collected from DevExpress Examples) contain references to the IsNewItem property.

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.

wpf-data-grid-implement-crud-operations/CS/CodeBehind/EFCore/LocalData/MainWindow.xaml.cs#L21

csharp
var row = (User)e.Row;
if(e.IsNewItem)
    _Context.Users.Add(row);

wpf-data-grid-extend-crud-operations/CS/Undo/UndoCRUDOperationsBehavior.cs#L103

csharp
var item = e.Row;
var isNewItem = e.IsNewItem;
undoAction = e.IsNewItem ? new Action(() => UndoAddAction(item)) : new Action(() => UndoEditAction(item));

wpf-data-grid-bind-to-infiniteasyncsource/CS/InfiniteAsyncSourceSample/MainWindow.xaml.cs#L116

csharp
void CreateUpdateRow(object sender, DevExpress.Xpf.Grid.GridRowValidationEventArgs e) {
    if(e.IsNewItem) {
        e.UpdateRowResult = IssuesService.AddNewIssueAsync((IssueData)e.Value);

wpf-data-grid-extend-crud-operations/VB/Undo/UndoCRUDOperationsBehavior.vb#L132

vb
Dim item = e.Row
Dim isNewItem = e.IsNewItem
undoAction = If(e.IsNewItem, New Action(Sub() UndoAddAction(item)), New Action(Sub() UndoEditAction(item)))

See Also

GridRowValidationEventArgs Class

GridRowValidationEventArgs Members

DevExpress.Xpf.Grid Namespace