Skip to main content

RepositoryItemTextEdit.ShowNullValuePrompt Property

Gets or sets conditions under which this editor should display its null value text (see the NullValuePrompt property).

Namespace: DevExpress.XtraEditors.Repository

Assembly: DevExpress.XtraEditors.v23.2.dll

NuGet Package: DevExpress.Win.Navigation

Declaration

[DXCategory("Appearance")]
public ShowNullValuePromptOptions ShowNullValuePrompt { get; set; }

Property Value

Type Description
ShowNullValuePromptOptions

Specifies conditions under which this editor should display its null value text.

Available values:

Name Description
NullValue

Disables all options. A prompt is only shown for an editable, not focused editor whose value equals null (Nothing in VB).

EmptyValue

A prompt is displayed when the editor’s value equals String.Empty or null (Nothing in VB). Disable this option to only display the prompt when the editor’s value equals null (Nothing in VB).

EditorFocused

A prompt is displayed when the editor is focused and not focused. Disable this option to only display the prompt when the editor is not focused.

EditorReadOnly

A prompt is displayed when the editor is in the read-only and editable states. Disable this option to only display the prompt when the editor is editable.

Default

Enables all options.

Remarks

If you specify the NullValuePrompt property, the editor displays this grayed-out text only when this editor is editable, not focused, and its EditValue is null. The ShowNullValuePrompt property allows you to expand the number of cases when the NullValuePrompt text is visible.

  • EmptyValue - the editor displays its NullValuePrompt text when the EditValue is null or empty (String.Empty).
  • EditorReadOnly - allows non-editable (read-only) editors with null value to display NullValuePrompt text.
  • EditorFocused - an editable editor with null value keeps showing its NullValuePrompt in both focused and unfocused states.
  • NullValue - none of the additional conditions are enabled.
  • Default - all three additional conditions are enabled.

The ShowNullValuePromptOptions is a flag enumeration, and the ShowNullValuePrompt property can accept more that one value.

textEdit1.Properties.ShowNullValuePrompt =
    ShowNullValuePromptOptions.EditorFocused | ShowNullValuePromptOptions.EmptyValue;

Note that the editor keeps its NullValuePrompt text until a user starts editing (clicks a focused or double-clicks an unfocused editor).

See Also