Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

CommandState Class

Contains a command’s state.

#Declaration

TypeScript
export class CommandState

#Properties

#enabled Property

Returns whether the command is enabled in the RichEdit control.

#Declaration

TypeScript
readonly enabled: boolean

#Property Value

Type Description
boolean

true if the command is enabled; otherwise, false.

#Remarks

var fontColorEnabled = richEdit.getCommandState(DevExpress.RichEdit.HomeTabCommandId.ChangeFontForeColor).enabled;

#value Property

Returns the command’s value.

#Declaration

TypeScript
readonly value?: any

#Property Value

Type Description
any

The command’s value. undefined if the command does not have a value or has multiple values in the selection.

#Remarks

var currentFontColor = richEdit.getCommandState(DevExpress.RichEdit.HomeTabCommandId.ChangeFontForeColor).value;

#visible Property

Returns whether the command is visible.

#Declaration

TypeScript
readonly visible: boolean

#Property Value

Type Description
boolean

true if the command is visible; otherwise, false.

#Remarks

var copyCommandVisible = richEdit.getCommandState(DevExpress.RichEdit.ContextMenuCommandId.Copy).visible;