[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Collapse]WPF Controls
  Prerequisites
 [Expand]What's Installed
 [Expand].NET Core 3 Support
 [Expand]Common Concepts
 [Expand]MVVM Framework
 [Collapse]Controls and Libraries
   Reporting
  [Expand]Data Grid
  [Expand]Ribbon, Bars and Menu
  [Expand]Charts Suite
  [Expand]Pivot Grid
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Tree List
  [Expand]Gauge Controls
  [Expand]Map Control
  [Expand]Layout Management
  [Expand]Windows Modern UI
  [Expand]Printing-Exporting
  [Collapse]Data Editors
    Included Components
   [Expand]Implementation Details
   [Expand]Getting Started
   [Collapse]Editor Types
     AutoSuggestEdit
     BarCodeEdit
     BrushEdit
     ButtonEdit
     Calculator
     CheckEdit
     ColorEdit
     ComboBoxEdit
     DateNavigator
     DateEdit
     DropDownButton
     FlyoutControl
     FontEdit
     HyperlinkEdit
     ImageEdit
     ListBoxEdit
     LookUpEdit
     MemoEdit
     PasswordBoxEdit
     PopupBrushEdit
     PopupCalcEdit
     PopupColorEdit
     PopupImageEdit
     ProgressBarEdit
     RangeControl
     RatingEdit
     SparklineEdit
     SpinEdit
     SimpleButton
     SplitButton
     TextEdit
     ToggleSwitch
     Token Editors
     TrackBarEdit
   [Expand]Common Features
   [Expand]Range Control
   [Expand]Visual Elements
   [Expand]End-User Capabilities
   [Expand]Examples
  [Expand]Navigation Controls
  [Expand]Spell Checker
  [Expand]Property Grid
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Gantt Control
  [Expand]Diagram Control
  [Expand]Windows and Utility Controls
   Dialogs, Notifications and Panels
  [Expand]Scheduler (legacy)
 [Expand]Scaffolding Wizard
 [Expand]Localization
  Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

AutoSuggestEdit

Expanded Overview

The AutoSuggestEdit (see AutoSuggestEdit) is an editor that displays a drop-down list of suggestions as the user types in the text box.

The editor is useful in the following cases:

  • Re-build the suggestion list on-the-fly

    The AutoSuggestEdit can display a dynamically populated list of suggestions. You can enable the search text highlight. You can populate the item list with any items that you consider appropriate for the entered string. With the AutoSuggestEdit, you can search against large data sources without any UI performance degradation.

  • Use advanced search

    You can control which items to display in the suggestion list. The editor allows you to populate a list of suggestions via a custom search engine, fuzzy search, remote web service, etc.

The AutoSuggestEdit control offers the following features.

Expanded Dynamically Loaded Suggestions

The editor fires the AutoSuggestEdit.QuerySubmitted event when an end user types in the editor's text box. In the event handler, you can:

  • get the entered text
  • use this text to search for relevant suggestions (using search engines, fuzzy search, etc.)
  • provide suggestions for the editor to display in its drop-down list. In this case, assign a collection of suggestions to the editor's AutoSuggestEdit.ItemsSource property.

Expanded Custom Control in Editor Popup

Use the PopupBaseEdit.PopupContentTemplate property to define a custom control that displays suggestions in the AutoSuggestEdit's popup. The custom control's x:Name property should be set to "PART_Content".

If the PopupContentTemplate (see PopupBaseEdit.PopupContentTemplate) is not specified, the editor uses the DevExpress.Xpf.Editors.Popup.AutoSuggestListBox control to display a collection item list. AutoSuggestListBox is a System.Windows.Controls.ListBox descendant designed to be used in the AutoSuggestEdit's popup.

Expanded Customize Items

Appearance

You can change the AutoSuggestEdit items' appearance via WPF templates. Use the AutoSuggestEdit's AutoSuggestEdit.ItemTemplate property to specify the item template.

You can apply different templates to an editor's drop-down items using custom logic implemented in the AutoSuggestEdit.ItemTemplateSelector.

Content

When the editor suggestions are represented by complex objects, use the following properties:

You can specify the AutoSuggestEdit.ItemStringFormat property to define how to format suggestions' display text.

Expanded Item Highlight

Use the following API to highlight the search text in a list of suggestions.

Member Description
AutoSuggestEdit.AllowPopupTextHighlighting Gets or sets whether the editor highlights the search results in its drop-down text according to the AutoSuggestEdit.PopupHighlightedTextCriteria criteria.
AutoSuggestEdit.PopupHighlightedTextCriteria Gets the filter condition (comparison operator) used to highlight the text in drop-down suggestions.
AutoSuggestEdit.CustomPopupHighlightedText Occurs when an end-user types into the editor's text box and allows you to provide a custom text to highlight.

Expanded Standalone AutoSuggestEdit

To add a standalone AutoSuggestEdit to a Window, drag it from the Toolbox.

The following example demonstrates how to create an AutoSuggestEdit in markup.

Expanded In-Place AutoSuggestEdit

Use the AutoSuggestEditSettings class to embed an AutoSuggestEdit in a container control.

The following example demonstrates how to embed an AutoSuggestEdit in a GridControl column.

Expanded Examples

Is this topic helpful?​​​​​​​