windowsforms-devexpress-dot-xtraeditors-dot-controls-dot-querydisplaytexteventargs.md
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
public string DisplayText { get; set; }
Public Property DisplayText As String
| Type | Description |
|---|---|
| String |
A string value specifying the editor’s formatted display text.
|
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
{
e.DisplayText = richEditControl.Document.Text;
}
winforms-create-editable-grid-lookup/CS/PopupContainerEditSelection/Form1.cs#L41
{
e.DisplayText = e.EditValue != null ? e.EditValue.ToString() : "";
}
winforms-grid-popupcontaineredit-with-dynamic-content/CS/Q148684/Form1.cs#L72
private void OnDetailsEditQueryDisplayText(object sender, QueryDisplayTextEventArgs e) {
e.DisplayText = "Edit Details";
}
winforms-grid-display-edit-rtf-data/VB/Form1.vb#L58
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
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
Private Sub OnDetailsEditQueryDisplayText(ByVal sender As Object, ByVal e As QueryDisplayTextEventArgs) Handles detailsEdit.QueryDisplayText
e.DisplayText = "Edit Details"
End Sub
See Also
QueryDisplayTextEventArgs Class