Skip to main content
A newer version of this page is available. .

RepositoryItem.CustomDisplayText Event

Enables custom display text to be provided for an editor.

Namespace: DevExpress.XtraEditors.Repository

Assembly: DevExpress.XtraEditors.v18.1.dll

Declaration

[DXCategory("Events")]
public event CustomDisplayTextEventHandler CustomDisplayText

Event Data

The CustomDisplayText event's data class is CustomDisplayTextEventArgs. The following properties provide information specific to this event:

Property Description
DisplayText Gets or sets an editor’s display text.
Value Gets an editor’s current value.

Remarks

The CustomDisplayText event can be used to provide custom display text for an editor. The event fires when an editor has no focus.

To provide custom text, assign it to the event’s DisplayText parameter. Initially, this property contains the current display text, which is a formatted representation of the editor’s edit value. To access the editor’s edit value, use the Value parameter.

For ImageComboBoxEdit editors, the CustomDisplayText event only fires when no value is selected in the editor (the ComboBoxEdit.SelectedIndex is set to -1). When a value is selected, the CustomDisplayText event doesn’t fire. In this instance, the display text is specified by the selected item’s ImageComboBoxItem.Description property.

The CustomDisplayText event also fires for cells in a container control (e.g GridControl, etc) if a repository item object is assigned to the control’s column/cell for in-place editing. In display mode (when an in-place editor is not active), the CustomDisplayText event fires with the sender parameter, specifying a corresponding repository item object (the RepositoryItem class’ descendant). When an in-place editor is activated, the CustomDisplayText event doesn’t fire. However, it’s possible to disable the text editing feature via the RepositoryItemButtonEdit.TextEditStyle property. In this instance, when the editor is activated, the CustomDisplayText event fires with the sender parameter specifying a corresponding editor object (the BaseEdit class’ descendant).

After your CustomDisplayText event handler is complete, the display text may be modified according to the RepositoryItemTextEdit.CharacterCasing option.

The BaseEdit.CustomDisplayText event is equivalent to the current event.

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

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.

See Also