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.1.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