Back to Devexpress

ShowingEditorEventArgsBase.Cancel Property

wpf-devexpress-dot-xpf-dot-grid-dot-showingeditoreventargsbase.md

latest2.7 KB
Original Source

ShowingEditorEventArgsBase.Cancel Property

Gets or sets the value indicating whether to prevent showing the editor.

Namespace : DevExpress.Xpf.Grid

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

NuGet Package : DevExpress.Wpf.Grid.Core

Declaration

csharp
public bool Cancel { get; set; }
vb
Public Property Cancel As Boolean

Property Value

TypeDescription
Boolean

true to cancel the action; otherwise, false.

|

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Cancel 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-disable-rows-based-on-their-values/CS/WpfApplication/DisableRowBehavior.cs#L17

csharp
if(e.Column.FieldName != nameof(Item.AllowEdit))
        e.Cancel = !(AssociatedObject.DataControl.CurrentItem as Item).AllowEdit;
}

wpf-data-grid-disable-rows-based-on-their-values/VB/WpfApplication/DisableRowBehavior.vb#L20

vb
Private Sub OnEditorShowing(ByVal sender As Object, ByVal e As ShowingEditorEventArgs)
    If Not Equals(e.Column.FieldName, NameOf(Item.AllowEdit)) Then e.Cancel = Not TryCast(AssociatedObject.DataControl.CurrentItem, Item).AllowEdit
End Sub

See Also

Edit Cell Values in UI

ShowingEditorEventArgsBase Class

ShowingEditorEventArgsBase Members

DevExpress.Xpf.Grid Namespace