Back to Devexpress

ComboBoxColumn.EditorFilterMode Property

mobilecontrols-devexpress-dot-xamarinforms-dot-datagrid-dot-comboboxcolumn.md

latest4.5 KB
Original Source

ComboBoxColumn.EditorFilterMode Property

Gets or sets the operator (starts with, contains, etc.) used to compare values in the drop-down list with the text entered in a cell.

Namespace : DevExpress.XamarinForms.DataGrid

Assembly : DevExpress.XamarinForms.Grid.dll

NuGet Package : DevExpress.XamarinForms.Grid

Declaration

csharp
[XtraSerializableProperty]
public FilterMode EditorFilterMode { get; set; }

Property Value

TypeDescription
FilterMode

A value that specifies a comparison operator.

|

Available values:

NameDescription
StartsWith

Data items should start with the entered text.

| | EndsWith |

Data items should end with the entered text.

| | Contains |

Data items should contain the entered text.

|

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:

  • EditorFilterMode — specifies whether values in the drop-dow 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://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:dxg="http://schemas.devexpress.com/xamarin/2014/forms/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"
                                EditorFilterMode="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 Xamarin.Forms;

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

EditorFilterComparisonType

IsEditorFilterEnabled

ComboBoxColumn Class

ComboBoxColumn Members

DevExpress.XamarinForms.DataGrid Namespace