Skip to main content

DevExpress v24.1 Update — Your Feedback Matters

Our What's New in v24.1 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

SearchMode Enum

Enumerates search modes for a lookup edior.

Namespace: DevExpress.XtraEditors.Controls

Assembly: DevExpress.XtraEditors.v24.1.dll

NuGet Package: DevExpress.Win.Navigation

#Declaration

public enum SearchMode

#Members

Name Description
OnlyInPopup

The incremental search is enabled only when the dropdown window is open. If the window is closed, the user can modify the text in the edit box. However these changes are ignored.

When the dropdown is open the incremental search is performed against the column whose index is specified by the RepositoryItemLookUpEdit.AutoSearchColumnIndex property. The header of this column contains the search icon (binoculars). The user can click a specific column header to perform the search against this column.

LookupEdit_SearchMode_AutoComplete_search

AutoComplete

Enables the automatic completion feature. In this mode, when the dropdown is closed, the text in the edit box is automatically completed if it matches a RepositoryItemLookUpEditBase.DisplayMember field value of one of dropdown rows. LookupEdit_SearchMode_AutoComplete_complete When the dropdown is open, the automatic completion feature is disabled but the editor allows you to perform an incremental search in the same manner as when SearchMode.OnlyInPopup mode is active. The found value is immediately applied to the editor as a user types a query.

AutoFilter

Enables the incremental filtering feature. When you type within the edit box, the editor automatically opens the dropdown window and displays only records whose RepositoryItemLookUpEditBase.DisplayMember field value starts with the characters typed. Other records are not displayed. If you enter a value that does not match any record, the dropdown window will not contain any rows.

The found value is immediately applied to the editor as a user types a query.

LookupEdit_SearchMode_AutoFilter

AutoSuggest

The editor fires the AutoSuggest event that you should handle to assign an asynchronous Task. The task must check the user text currently entered into the editor’s text box, and return a list of matching items. This list is then assigned to the editor’s DataSource property.

demo-autosuggest

AutoSearch

The editor unlocks its text box and allows users to type in text. Data source records that match this text are shown in the drop-down panel. The user must highlight the required row to select a new value.

search

Handle the AutoSearch event to fine-tune the search:

void LookUpEdit_AutoSearchComplete(object sender, LookUpEditAutoSearchCompleteEventArgs e) {
  LookUpEdit le = sender as LookUpEdit;
  var popupForm = le.GetPopupEditForm();
  if(popupForm != null) {
      if(popupForm.SelectedIndex < 0 && popupForm.Filter.RowCount == 1)
          popupForm.SelectedIndex = 0;
  }
}

#Related API Members

The following properties accept/return SearchMode values:

#Remarks

The SearchMode type enumerates search modes for a LookUpEdit control. You can access these settings via the RepositoryItemLookUpEdit.SearchMode property. See the description of fields below for more information on each mode.

See Also