SearchLookUpEdit Class

The editor that provides lookup functionality using a dropdown feature-rich data grid (GridControl), and contains the built-in Find Panel, allowing end-users to quickly filter and locate dropdown records. You can display lookup records in a tabular format, banded tabular format, or as tiles (which can be arranged in one or multiple columns/rows, rendered as a list or a Kanban board).

Namespace: DevExpress.XtraEditors

Assembly: DevExpress.XtraGrid.v20.1.dll

Declaration

public class SearchLookUpEdit :
    GridLookUpEditBase
Public Class SearchLookUpEdit
    Inherits GridLookUpEditBase

Related API Members

The following members accept/return SearchLookUpEdit objects:

Remarks

A lookup editor is an editor with an embedded dropdown window which displays lookup records (the records from which an end-user can select). When a lookup record is selected, the editor's value (the BaseEdit.EditValue bindable property) and display text are modified accordingly.

The SearchLookUpEdit supports a built-in Find Panel, which allows an end-user to quickly locate rows by the text they contain.

The SearchLookUpEdit can display lookup records in the dropdown using multiple data presentation formats (Views), which you can choose with the RepositoryItemGridLookUpEditBase.PopupViewType property:

  • Grid View (default) - Displays data in a tabular form. The following features, and many more, can be employed for the Grid View embedded in the SearchLookUpEdit: data sorting, grouping, filtering, summaries, hiding column headers, changing row height, etc. See Grid View to learn more.

    SearchLookUpEdit_withfilter

  • Tile View - Displays records as read-only tiles, using one of the following layout modes: default (standard table layout), list (tiles have no space between them) and Kanban. This View provides the Tile Template feature, which helps you arrange fields relative to other fields, specify absolute or relative field display bounds, etc. See Tile View.

    SearchLookUpEdit-TileView

  • Banded Grid View - Displays data in a tabular form and allows grouping of columns into bands. See Banded Grid Views.

    SearchLookUpEdit-BandedView.png

  • Advanced Banded Grid View - Displays data in a tabular form, allows grouping columns into bands and supports complex data cell arrangements. See Banded Grid Views.

    SearchLookUpEdit-AdvBandedView.png

After you have set the RepositoryItemGridLookUpEditBase.PopupViewType property, the SearchLookUpEdit control creates a corresponding View object. This View can now be accessed and customized from the RepositoryItemGridLookUpEditBase.PopupView property. At design time, you can customize the View with the Data Grid Designer, which you can open by clicking the ellipsis button for the PopupView property in Properties grid, or by invoking the Design View command (from the Properties window or the control's smart tag).

SearchLookUpEdit-Designer.png

NOTE

The PopupView property specifies a ColumnView object that is a template for the pop-up view. Based on the template, the editor creates a new ColumnView object that represents the view actually displayed in the pop-up window.

If you customize the view in an event, event arguments refer to the view actually displayed in the pop-up window, not the template view. Do not use objects to identify the view, columns, etc.; use field names, captions, etc. instead. The example below shows how to identify a column in a CustomDrawCell event handler.

private void SearchLookUpEdit1View_CustomDrawCell(object sender, >DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventArgs e) {
   if (e.Column.FieldName == "MyFieldName") {
       // Your code here.
   }
}

To learn how to set up lookup editors in different binding modes, see the following topics:

You may want to filter the popup data source of one (secondary) lookup editor based on a value of another (primary) lookup editor. This scenario is covered in the following topic:

The SearchLookUpEdit and GridLookUpEdit controls have many features in common. These controls are identically created and customized (except for the additional features that are only typical to the SearchLookUpEdit control). Please refer to the GridLookUpEdit topic for an example.

Additional Customization

The following list shows some of the members that help you perform the additional customization of the SearchLookUpEdit control.

Search Settings

There are two search modes - automatic and manual. In automatic search mode, a search starts following a small delay after an end-user has stopped typing text. In manual search mode, a search is started manually by pressing ENTER or clicking the Find button.

Automatic search mode is in effect in the following cases:

Manual search mode is in effect in the following cases:

The RepositoryItemGridLookUpEditBase.PopupFilterMode property specifies how dropdown rows are filtered - using the Contains or StartsWith filter. By default, this property is set to PopupFilterMode.Default, which is equivalent to the Contains filter.

The PopupFilterMode property also affects columns against which data is searched. See the PopupFilterMode topic to learn more.

To embed a SearchLookUpEdit in a cell within a container control (XtraGrid, XtraTreeList, etc), use the RepositoryItemSearchLookUpEdit component. See Repository items for more information.

NOTE

The SearchLookUpEdit clears the active filter after closing the dropdown window.

NOTE

Instant Feedback Mode is supported by the SearchLookUpEdit when the control is used as a standalone control and when the control is used as an in-place editor within a Grid Control.

NOTE

The GridLookUpEdit and SearchLookUpEdit controls do not have a connection to their underlying data sources while their dropdown windows are closed. So in this instance it is not possible to access the underlying data or a grid's calculated data using methods provided by the embedded Grid Control and its View. You can use these methods only when the controls' dropdown windows are open.

While the dropdown windows are closed, you can access the underlying data using methods provided by the underlying data source.

See Also