AutoSuggestEdit.QuerySubmitted Event

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

Declaration

public event EventHandler<AutoSuggestEditQuerySubmittedEventArgs> QuerySubmitted
Public Event QuerySubmitted As EventHandler(Of AutoSuggestEditQuerySubmittedEventArgs)

Event Data

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.

Remarks

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.

Example

<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();
}
See Also