Back to Devexpress

LookUpEditAutoSearchEventArgs.SetParameters(String, String, FindPanelParserKind, FilterCondition) Method

windowsforms-devexpress-dot-xtraeditors-dot-controls-dot-lookupeditautosearcheventargs-dot-setparameters-x28-string-string-findpanelparserkind-filtercondition-x29.md

latest3.5 KB
Original Source

LookUpEditAutoSearchEventArgs.SetParameters(String, String, FindPanelParserKind, FilterCondition) Method

Allows you to change how the lookup editor searches for items in its drop-down panel.

Namespace : DevExpress.XtraEditors.Controls

Assembly : DevExpress.XtraEditors.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
public void SetParameters(
    string fieldName,
    string text,
    FindPanelParserKind kind = FindPanelParserKind.Default,
    FilterCondition condition = FilterCondition.Default
)
vb
Public Sub SetParameters(
    fieldName As String,
    text As String,
    kind As FindPanelParserKind = FindPanelParserKind.Default,
    condition As FilterCondition = FilterCondition.Default
)

Parameters

NameTypeDescription
fieldNameString

The name of a field whose values should be compared with the search text.

| | text | String |

A text to compare with data source records.

|

Optional Parameters

NameTypeDefaultDescription
kindFindPanelParserKindDefault

If a text entered into the editor text box contains whitespaces, the editor splits this string into separate logical blocks. This parameter specifies how these blocks are combined into a search query.

| | condition | FilterCondition | Default |

The condition according to which the editor searches for the string entered into its text box.

|

Remarks

The example below illustrates how to limit the search by the “Ship Country” and “Ship City” fields, and change the search condition to “Starts with…”.

csharp
lookUpEdit1.AutoSearch += OnAutoSearch;

void OnAutoSearch(object sender, LookUpEditAutoSearchEventArgs e) {
    string[] fields = new string[] { "ShipCity", "ShipCountry" };
    e.SetParameters(fields, e.Text, FindPanelParserKind.And, FilterCondition.StartsWith);
}
vb
Private lookUpEdit1.AutoSearch += AddressOf OnAutoSearch

Private Sub OnAutoSearch(ByVal sender As Object, ByVal e As LookUpEditAutoSearchEventArgs)
    Dim fields() As String = { "ShipCity", "ShipCountry" }
    e.SetParameters(fields, e.Text, FindPanelParserKind.And, FilterCondition.StartsWith)
End Sub

See Also

LookUpEditAutoSearchEventArgs Class

LookUpEditAutoSearchEventArgs Members

DevExpress.XtraEditors.Controls Namespace