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

AutoSuggestEdit.CustomPopupHighlightedText Event

Occurs when an end-user types into the editor’s text box and allows you to provide a custom text to highlight.

Namespace: DevExpress.Xpf.Editors

Assembly: DevExpress.Xpf.Core.v24.2.dll

NuGet Package: DevExpress.Wpf.Core

#Declaration

public event EventHandler<AutoSuggestEditCustomPopupHighlightedTextEventArgs> CustomPopupHighlightedText

#Event Data

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

Property Description
Handled Gets or sets whether a text highlight operation is handled and no default processing is required.
Text Gets or sets a text to be highlighted.

#Remarks

Handle the CustomPopupHighlightedText event to customize the text to highlight. Use the event arguments’ Text property to get the default highlighted text, and to set the custom text.

<dxe:AutoSuggestEdit 
    ImmediatePopup="True"
    ItemStringFormat="City: {0}"
    ItemsSource="{Binding Cities}"
    PopupHighlightedTextCriteria="StartsWith"
    CustomPopupHighlightedText="AutoSuggestEdit_CustomPopupHighlightedText"/>
private void AutoSuggestEdit_CustomPopupHighlightedText(object sender, AutoSuggestEditCustomPopupHighlightedTextEventArgs e) {
    e.Text = string.IsNullOrEmpty(e.Text) ? null : "City: " + e.Text;
    e.Handled = true;
}
See Also