Back to Devexpress

ComboBoxEditBase.FilterCondition Property

maui-devexpress-dot-maui-dot-editors-dot-comboboxeditbase-6a1f49c1.md

latest3.9 KB
Original Source

ComboBoxEditBase.FilterCondition Property

Gets or sets the comparison operator used to search for the drop-down list items by the entered fragment. This is a bindable property.

Namespace : DevExpress.Maui.Editors

Assembly : DevExpress.Maui.Editors.dll

NuGet Package : DevExpress.Maui.Editors

Declaration

csharp
public DataFilterCondition FilterCondition { get; set; }

Property Value

TypeDescription
DataFilterCondition

The filtering condition.

|

Available values:

NameDescription
Default

The filter condition depends on the type of the column.

| | StartsWith |

Values in a column should start with the value in the Auto Filter Row.

| | Contains |

Values in a column should contain the value in the Auto Filter Row.

| | Equals |

Values in a column should equal the value in the Auto Filter Row.

|

Example

The following example shows how to customize combo box appearance and set up item filtering.

|

State

|

Appearance

| | --- | --- | |

Unfocused

|

| |

Focused

|

| |

Filtered

|

|

xml
<dxe:ComboBoxEdit ItemsSource="{Binding}"

                  LabelText="Employee"
                  IsLabelFloating="True"
                  HelpText="Select an e-mail"
                  BorderColor="Black"
                  FocusedBorderColor="DarkOrange"
                  BackgroundColor="Beige"
                  LabelColor="Black"
                  FocusedLabelColor="DarkOrange"
                  CornerRadius="10"
                  CornerMode="Cut"
                  DropDownBackgroundColor="Beige"
                  DropDownSelectedItemBackgroundColor="Brown"
                  DropDownSelectedItemTextColor="White"

                  IsFilterEnabled="True"
                  FilterCondition="StartsWith"
                  FilterComparisonType="CurrentCultureIgnoreCase">

  <dxe:ComboBoxEdit.ItemTemplate>
    <DataTemplate>
      <Grid>
        <Label Margin="10,15,0,15" Text="{Binding Name}" FontAttributes="Bold"/>
        <Label Margin="0,15,0,15" Grid.Column="1" Text="{Binding Age}"/>
        <Label Margin="0,15,10,15" Grid.Column="2" Text="{Binding Location}" HorizontalTextAlignment="End"/>
      </Grid>
    </DataTemplate>
  </dxe:ComboBoxEdit.ItemTemplate>
</dxe:ComboBoxEdit>
cs
using System.Collections.Generic;
using System.ComponentModel;
using Microsoft.Maui.Controls;

namespace ComboBoxExample {
    public partial class MainPage : ContentPage {
        public MainPage() {
            InitializeComponent();
            this.BindingContext = new List<Person>() {
                new Person {Name = "Jane", Age = 43, Location = "Atlanta"},
                new Person {Name = "Margaret", Age = 25, Location = "Memphis"},
                new Person {Name = "Debbie", Age = 28, Location = "New-York"},
                new Person {Name = "John", Age = 19, Location = "Detroit"},
                new Person {Name = "Derek", Age = 36, Location = "Houston"}
            };
        }
    }

    public class Person {
        public string Name { get; set; }
        public int Age { get; set; }
        public string Location { get; set; }
    }
}

See Also

ComboBoxEditBase Class

ComboBoxEditBase Members

DevExpress.Maui.Editors Namespace