Skip to main content
.NET Framework 4.5.2+

How to: Add a Search Action to Lookup Property Editors and Link Pop-up Windows

  • 3 minutes to read

Lookup Property Editors that display reference properties contain a list of existing objects of the specified type in the drop-down menu. Similarly, the Link Action’s pop-up windows display a list of available objects of the specified type. The following image demonstrates both the Lookup Property Editor’s drop-down window and the Link Action’s pop-up window:

ASP.NET Core Blazor
XAF ASP.NET Core Blazor Lookup Property Editor and Link Popup Window, DevExpress
Windows Forms
XAF Windows Forms Lookup Property Editor and Link Popup Window, DevExpress

This topic explains how to enable the Search functionality that allows you to quickly find the required object when there are many objects to be shown.

Note

In XAF ASP.NET Core Blazor applications, the Search functionality is always available in the Link Action’s pop-up window.

Search Functionality

ASP.NET Core Blazor

XAF ASP.NET Core Blazor Look-up Property Editor in Search Mode, DevExpress

XAF ASP.NET Core Blazor Look-up Property Editor Search Pop-up Window, DevExpress

Windows Forms
XAF Windows Forms Look-up Property Editor in Search Mode, DevExpress
ASP.NET Web Forms
XAF ASP.NET Web Forms Look-up Property Editor in Search Mode, DevExpress

The Search button executes FullTextFilterAction of the FilterController. It looks for objects whose property values (string representations) include the value specified by the user. Properties that take part in search are listed in the Views | <ListView> node that defines the List View. They can be visible or invisible, persistent or non-persistent. For more information, refer to the following topic: FilterController.

Automatic Activation

In Windows Forms and ASP.NET Web Forms applications, XAF automatically enables the Search functionality when a List View in a Lookup Property Editor or Link Action’s pop-up window contains more than 25 objects.

You can specify a different limit in the IModelOptions.LookupSmallCollectionItemCount property of the Application Model‘s Options node.

XAF LookupSmallCollectionItemCount Property in Model Editor, DevExpress

In Code

To enable the Search functionality in the Lookup Property Editor or Link Action’s pop-up window with any number of objects in the List View’s collection source, apply the LookupEditorModeAttribute to the required property (a reference of collection property). Specify one of the following modes for the corresponding Lookup Property Editor or Link Action’s pop-up window:

Mode

Loaded objects

Search functionality

Auto

ASP.NET Core Blazor: All objects of the specified type.

Windows Forms, ASP.NET Web Forms: None if the object count in the property’s data source collection is less than the value of the LookupSmallCollectionItemCount property.

ASP.NET Core Blazor: Disabled.

Windows Forms, ASP.NET Web Forms: Disabled if the object count in the property’s data source collection is less than the value of the LookupSmallCollectionItemCount property.

AllItems

All objects of the specified type.

Not enabled.

Search

None.

Enabled.

AllItemsWithSearch

All objects of the specified type.

Enabled.

To set the required mode, pass the corresponding value as the LookupEditorModeAttribute‘s parameter.

In Application Model

In the Model Editor, set the LookupEditorMode property of the BOModel | <Class> | OwnMembers | <Member> node to the required value.