Back to Devexpress

ComboBoxColumn.EditorFilterComparisonType Property

maui-devexpress-dot-maui-dot-datagrid-dot-comboboxcolumn-39ff8456.md

latest4.0 KB
Original Source

ComboBoxColumn.EditorFilterComparisonType Property

Gets or sets a value that specifies how to compare the text entered in a cell with values in the drop-down list. This is a bindable property.

Namespace : DevExpress.Maui.DataGrid

Assembly : DevExpress.Maui.DataGrid.dll

NuGet Package : DevExpress.Maui.DataGrid

Declaration

csharp
public StringComparison EditorFilterComparisonType { get; set; }

Property Value

TypeDescription
StringComparison

A value that specifies how to compare the entered text with values in the collection.

|

Remarks

Enable the IsEditorFilterEnabled option to allow users to type in cells. Values in the drop-down list are filtered according to the entered text and following settings:

  • EditorFilterCondition — specifies whether values in the drop-down window should start with or contain the entered text.
  • EditorFilterComparisonType — specifies how to compare the entered text with values in the drop-down list.

To specify the list of available values, use the ItemsSource collection.

Example

The example below uses the ComboBoxColumn to display available values in the drop-down list when a user types in a cell.

xml
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:dxg="clr-namespace:DevExpress.Maui.DataGrid;assembly=DevExpress.Maui.DataGrid"
             xmlns:scg="clr-namespace:System.Collections.Generic;assembly=netstandard">
    <dxg:DataGridView ItemsSource="{Binding Path=Employees}"
                      EditorShowMode="Tap">
        <dxg:DataGridView.Columns>
            <!-- Other columns here. -->
            <dxg:ComboBoxColumn FieldName="JobTitle" 
                                EditorFilterComparisonType="CurrentCultureIgnoreCase"
                                EditorFilterCondition="StartsWith"
                                IsEditorFilterEnabled="True">
                <dxg:ComboBoxColumn.ItemsSource>
                    <scg:List x:TypeArguments="x:String">
                        <x:String>Chief Executive Officer</x:String>
                        <x:String>Chief Technology Officer</x:String>
                        <x:String>Network Administrator</x:String>
                    </scg:List>
                </dxg:ComboBoxColumn.ItemsSource>
            </dxg:ComboBoxColumn>
            <!-- Other columns here. -->
        </dxg:DataGridView.Columns>
    </dxg:DataGridView>
</ContentPage>
cs
using System.Collections.Generic;
using System.ComponentModel;
using Microsoft.Maui.Controls;

public partial class EditingView : ContentPage {
    public EditingView() {
        InitializeComponent();
        BindingContext = new Repository(300);
    }
}

public class Repository {
    public ObservableCollection<Employee> Employees { get; private set; }

    public Repository(int rowsCount) {
        Employees = new ObservableCollection<Employees>();
        for (int i = 0; i < rowsCount; i++) {
            Employees.Add(new Employee());
        }
    }
}

public class Employee {
    public string FullName { get; set; }
    public string JobTitle { get; set; }
}

See Also

ComboBoxColumn Class

ComboBoxColumn Members

DevExpress.Maui.DataGrid Namespace