Back to Devexpress

LookUpEdit.PopupFilter Event

windowsforms-devexpress-dot-xtraeditors-dot-lookupedit-49bd9ce4.md

latest1.9 KB
Original Source

LookUpEdit.PopupFilter Event

Allows you to specify a custom filter expression for the LookUpEdit popup list.

Namespace : DevExpress.XtraEditors

Assembly : DevExpress.XtraEditors.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
[DXCategory("Events")]
public event PopupFilterEventHandler PopupFilter
vb
<DXCategory("Events")>
Public Event PopupFilter As PopupFilterEventHandler

Event Data

The PopupFilter event's data class is DevExpress.XtraEditors.Controls.PopupFilterEventArgs.

Remarks

The LookUpEdit raises the PopupFilter event before the dropdown list appears. Handle the PopupFilter event to filter records in the dropdown list. Use the e.Criteria event parameter to specify the filter expression.

The following example restricts the dropdown list to records where the “ShipCountry” field equals “Brazil”:

csharp
using DevExpress.Data.Filtering;
using DevExpress.XtraEditors.Controls;

void LookUpEdit1_PopupFilter(object sender, PopupFilterEventArgs e) {
    e.Criteria = CriteriaOperator.Parse("ShipCountry == 'Brazil'");
}
vb
Imports DevExpress.Data.Filtering
Imports DevExpress.XtraEditors.Controls

Private Sub LookUpEdit1_PopupFilter(ByVal sender As Object, ByVal e As PopupFilterEventArgs)
    e.Criteria = CriteriaOperator.Parse("ShipCountry == 'Brazil'")
End Sub

See Also

LookUpEdit Class

LookUpEdit Members

DevExpress.XtraEditors Namespace