All docs
V20.2
20.2
20.1
The page you are viewing does not exist in version 20.1. This link will take you to the root page.
19.2
The page you are viewing does not exist in version 19.2. This link will take you to the root page.
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
1.1
The page you are viewing does not exist in version 1.1. This link will take you to the root page.

ComboBoxColumn Class

A grid column used to display and edit text values. The column displays a drop-down list that contains available values.

Namespace: DevExpress.XamarinForms.DataGrid

Assembly: DevExpress.XamarinForms.Grid.dll

Declaration

public class ComboBoxColumn :
    PickerColumn

Remarks

The ComboBoxColumn is a column in the DataGridView that displays available values in a drop-down list.

The ItemsSource collection contains values that users can select in the drop-down list. If this collection contains business objects, use the following properties to describe the business object's data fields:

  • DisplayMember — specifies the data field that contains values that are displayed in the drop-down list.
  • ValueMember — specifies the data field that contains values that are actually assigned to cells.

Options

Use the following properties to adjust column settings:

  • IsEditorFilterEnabled — specifies whether users can type values in cells to filter items in the drop-down list.
  • EditorFilterMode — specifies the operator (starts with, contains, etc.) used to compare values in the drop-down list with the text entered in a cell.
  • EditorFilterComparisonType — specifies whether to compare values with respect to the current culture and case.
  • IsDropDownIconVisible — specifies the drop-down/drop-up icon visibility.

You can configure the following options related to all types of grid columns:

  • FieldName — specifies the name of the data source's field associated with the grid column, or serves as an identifier for an unbound column.
  • Caption — specifies the caption displayed in the column header.
  • DisplayFormat — specifies the pattern used to format values in the column's cells.
  • HorizontalContentAlignment, VerticalContentAlignment — specify the horizontal and vertical alignment of the column's content.
  • MinWidth, MaxWidth, Width — specify the column's minimum, maximum, and actual widths.
  • IsVisible — specifies whether the column is visible in the grid.

Use the following properties to sort and group data in the grid, and calculate cell values based on expressions:

The grid stores columns in the DataGridView.Columns collection. Depending on the AutoGenerateColumnsMode option, the grid automatically generates columns based on the bound data source, or you can add columns to the grid and associate them with data fields manually. See the following help topic for an example: Create Columns for Different Data Types.

Examples

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

<dxg:DataGridView ItemsSource="{Binding Path=Employees}">
    <dxg:DataGridView.Columns>
        <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>
    </dxg:DataGridView.Columns>
</dxg:DataGridView>

In the example below, the ComboBoxColumn is bound to a data field that contains integer values. To display strings instead of integers in the drop-down list, the example uses a business object that combines strings with integers. The DisplayMember and ValueMember properties specify data fields that contain displayed strings and actual integer values.

<dxg:DataGridView x:Name="dataGridView"
                  ItemsSource="{Binding Path=Employees}">
    <dxg:DataGridView.Columns>
        <dxg:ComboBoxColumn FieldName="Job" 
                            ItemsSource="{Binding Jobs}"
                            DisplayMember="Title"
                            ValueMember="Id"
                            IsEditorFilterEnabled="True">
        </dxg:ComboBoxColumn>
    </dxg:DataGridView.Columns>
</dxg:DataGridView>

Inheritance

Object
Xamarin.Forms.BindableObject
See Also