wpf-devexpress-dot-xpf-dot-editors-dot-autosuggestedit.md
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.v25.2.dll
NuGet Package : DevExpress.Wpf.Core
public event EventHandler<AutoSuggestEditCustomPopupHighlightedTextEventArgs> CustomPopupHighlightedText
Public Event CustomPopupHighlightedText As EventHandler(Of AutoSuggestEditCustomPopupHighlightedTextEventArgs)
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. |
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;
}
Private Sub AutoSuggestEdit_CustomPopupHighlightedText(ByVal sender As Object, ByVal e As AutoSuggestEditCustomPopupHighlightedTextEventArgs)
e.Text = If(String.IsNullOrEmpty(e.Text), Nothing, "City: " & e.Text)
e.Handled = True
End Sub
See Also