Back to Devexpress

LookUpEditBase.FilterCriteria Property

wpf-devexpress-dot-xpf-dot-editors-dot-lookupeditbase-4799fedf.md

latest3.7 KB
Original Source

LookUpEditBase.FilterCriteria Property

Gets or sets the filter expression applied to the LookUpEditBase.ItemsSource. This is a dependency property.

Namespace : DevExpress.Xpf.Editors

Assembly : DevExpress.Xpf.Core.v25.2.dll

NuGet Package : DevExpress.Wpf.Core

Declaration

csharp
public CriteriaOperator FilterCriteria { get; set; }
vb
Public Property FilterCriteria As CriteriaOperator

Property Value

TypeDescription
CriteriaOperator

A CriteriaOperator descendant that represents an external filter expression.

|

Remarks

The LookUpEdit control can filter data from an ItemSource before displaying. You can use the FilterCriteria property to set a Filter Expression. You can create your filter expression when the editor’s ItemSource is a complex type object (it has its own properties). i.e., Contains([SomeProperty], '123')

You can use the DisplayColumn value to create a filter expression when the editor’s item source is a simple objects collection:

csharp
LookUpEdit.FilterCriteria = new FunctionOperator(
  FunctionOperatorType.EndsWith, 
  new OperandProperty("DisplayColumn"), 
  new OperandValue("ask0")
);
vb
LookUpEdit.FilterCriteria = New FunctionOperator(
  FunctionOperatorType.EndsWith, 
  New OperandProperty("DisplayColumn"), 
  New OperandValue("ask0"))

For more information on how to create filter expressions, see Criteria Language Syntax and Creating Criteria.

How to: Populate ComboBoxEdit’s ItemsSource Based on Values From Other Cells

The GitHub example illustrates how to dynamically construct a filter depending on values from other cells.

View Example

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the FilterCriteria property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

wpf-gridcontrol-populate-inplace-comboboxedit-with-values-based-on-values-from-other-cells/CS/MainWindow.xaml#L27

xml
ItemsSource="{Binding View.DataContext.ComboBoxItems}"
FilterCriteria="{Binding RowData.Row.FilterType, Converter={local:FilterConverter}}"
IsTextEditable="False"

See Also

LookUpEditBase Class

LookUpEditBase Members

DevExpress.Xpf.Editors Namespace