Back to Devexpress

Command.CanExecute() Method

corelibraries-devexpress-dot-utils-dot-commands-dot-command-5b617116.md

latest1.5 KB
Original Source

Command.CanExecute() Method

Determines whether the command can execute in its current state.

Namespace : DevExpress.Utils.Commands

Assembly : DevExpress.Data.v25.2.dll

NuGet Package : DevExpress.Data

Declaration

csharp
public virtual bool CanExecute()
vb
Public Overridable Function CanExecute As Boolean

Returns

TypeDescription
Boolean

true if the command can execute; otherwise, false.

|

Remarks

UI controls that support commands (such as Bar Items) disable the control if the CanExecute is false. A command will only execute if the CanExecute is true. In case you want to execute an action if the command cannot be executed, use the Command.ForceExecute method instead of the Command.Execute.

See Also

Command Class

Command Members

DevExpress.Utils.Commands Namespace