Back to Devexpress

QueryDisplayTextEventArgs.DisplayText Property

windowsforms-devexpress-dot-xtraeditors-dot-controls-dot-querydisplaytexteventargs.md

latest5.0 KB
Original Source

QueryDisplayTextEventArgs.DisplayText Property

Gets or sets the text to display in the edit box.

Namespace : DevExpress.XtraEditors.Controls

Assembly : DevExpress.XtraEditors.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
public string DisplayText { get; set; }
vb
Public Property DisplayText As String

Property Value

TypeDescription
String

A string value specifying the editor’s formatted display text.

|

Remarks

Initially the DisplayText property depends on the RepositoryItem.EditFormat or RepositoryItem.DisplayFormat property value, depending on whether the editor is focused.

You can change the display text as required and thus override the default text representation. The edit value to be formatted is passed as the QueryDisplayTextEventArgs.EditValue property.

The following code snippets (auto-collected from DevExpress Examples) contain references to the DisplayText 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.

winforms-grid-display-edit-rtf-data/CS/Form1.cs#L68

csharp
{
    e.DisplayText = richEditControl.Document.Text;
}

winforms-create-editable-grid-lookup/CS/PopupContainerEditSelection/Form1.cs#L41

csharp
{
    e.DisplayText = e.EditValue != null ? e.EditValue.ToString() : "";
}

winforms-grid-popupcontaineredit-with-dynamic-content/CS/Q148684/Form1.cs#L72

csharp
private void OnDetailsEditQueryDisplayText(object sender, QueryDisplayTextEventArgs e) {
    e.DisplayText = "Edit Details";
}

winforms-grid-display-edit-rtf-data/VB/Form1.vb#L58

vb
Private Sub riPopup_QueryDisplayText(ByVal sender As Object, ByVal e As QueryDisplayTextEventArgs)
    e.DisplayText = richEditControl.Document.Text
End Sub

winforms-create-editable-grid-lookup/VB/PopupContainerEditSelection/Form1.vb#L32

vb
Private Sub popupContainerEdit1_QueryDisplayText(ByVal sender As Object, ByVal e As DevExpress.XtraEditors.Controls.QueryDisplayTextEventArgs)
    e.DisplayText = If(e.EditValue IsNot Nothing, e.EditValue.ToString(), "")
End Sub

winforms-grid-popupcontaineredit-with-dynamic-content/VB/Q148684/Form1.vb#L77

vb
Private Sub OnDetailsEditQueryDisplayText(ByVal sender As Object, ByVal e As QueryDisplayTextEventArgs) Handles detailsEdit.QueryDisplayText
    e.DisplayText = "Edit Details"
End Sub

See Also

EditValue

QueryDisplayText

DisplayFormat

EditFormat

QueryDisplayTextEventArgs Class

QueryDisplayTextEventArgs Members

DevExpress.XtraEditors.Controls Namespace