wpf-devexpress-dot-xpf-dot-editors-dot-autosuggestedit-86a22e6d.md
Fires when the editor’s text has been changed and allows you to provide any relevant suggestions that would be displayed in the editor’s popup window.
Namespace : DevExpress.Xpf.Editors
Assembly : DevExpress.Xpf.Core.v25.2.dll
NuGet Package : DevExpress.Wpf.Core
public event EventHandler<AutoSuggestEditQuerySubmittedEventArgs> QuerySubmitted
Public Event QuerySubmitted As EventHandler(Of AutoSuggestEditQuerySubmittedEventArgs)
The QuerySubmitted event's data class is AutoSuggestEditQuerySubmittedEventArgs. The following properties provide information specific to this event:
| Property | Description |
|---|---|
| Text | Gets the text entered by an end user. |
Handle the QuerySubmitted event to provide the AutoSuggestEdit with the suggestions that should be displayed in the editor’s popup window.
Use the event handler’s Text property to get the text currently entered by an end user.
<dxe:AutoSuggestEdit
QuerySubmitted="AutoSuggestEdit_QuerySubmitted">
</dxe:AutoSuggestEdit>
private void AutoSuggestEdit_QuerySubmitted(object sender, DevExpress.Xpf.Editors.AutoSuggestEditQuerySubmittedEventArgs e) {
((AutoSuggestEdit)sender).ItemsSource = string.IsNullOrEmpty(e.Text)
? null
: Customer.GetCustomers()
.Where(x => Regex.IsMatch(x.City, Regex.Escape(e.Text), RegexOptions.IgnoreCase | RegexOptions.IgnorePatternWhitespace))
.Take(10)
.ToList();
}
Private Sub AutoSuggestEdit_QuerySubmitted(ByVal sender As Object, ByVal e As DevExpress.Xpf.Editors.AutoSuggestEditQuerySubmittedEventArgs)
(CType(sender, AutoSuggestEdit)).ItemsSource = If(String.IsNullOrEmpty(e.Text), Nothing, Customer.GetCustomers().Where(Function(x) Regex.IsMatch(x.City, Regex.Escape(e.Text), RegexOptions.IgnoreCase Or RegexOptions.IgnorePatternWhitespace)).Take(10).ToList())
End Sub
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the QuerySubmitted event.
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.
wpf-data-grid-use-autosuggesteditsettings/CS/MainWindow.xaml.cs#L25
if (ActiveEditor != null)
ActiveEditor.QuerySubmitted += QuerySubmitted;
}
wpf-data-grid-use-autosuggesteditsettings/VB/MainWindow.xaml.vb#L26
ActiveEditor = TryCast(e.Editor, AutoSuggestEdit)
If ActiveEditor IsNot Nothing Then AddHandler ActiveEditor.QuerySubmitted, AddressOf QuerySubmitted
End Sub
See Also