Class GridComboBoxColumn
Represents a SfDataGrid column that hosts SfComboBox content in its cells.
Implements
Inherited Members
Namespace: Syncfusion.SfDataGrid.XForms
Assembly: Syncfusion.SfDataGrid.XForms.dll
Syntax
public class GridComboBoxColumn : GridColumn, IDisposable
Remarks
Use GridComboBoxColumn to display the columns of SfCombobox data as a GridComboBox.
To create a column, add it to the Columns collection. To populate the column, bind the column to the data by using the DisplayBinding property. The Binding property is applied to the Xamarin.Forms.Label view created in the column. The Xamarin.Forms.BindableObject.BindingContext for the view in each cell is the data item for the row the cell is in. Therefore, to set up the binding you only have to set the Xamarin.Forms.Binding.Path. Optionally, you can specify a Xamarin.Forms.Binding.Converter if you want to convert the data. In MacOS. We have loaded GridPicker in GridComboBoxColumn, since GridComboBox is not supported in MacOS.
Examples
<sfGrid:SfDataGrid.Columns>
<sfgrid:GridComboBoxColumn BindingContext = "{x:Reference viewModel}"
HeaderText="Dealer Name"
ItemsSource="{Binding CustomerNames}"
MappingName="DealerName"/>
</sfGrid:SfDataGrid.Columns>
Constructors
GridComboBoxColumn()
Initializes a new instance of the GridComboBoxColumn class.
Declaration
public GridComboBoxColumn()
Fields
AutoCompleteModeProperty
Identifies the AutoCompleteMode Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty AutoCompleteModeProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
CanFilterSuggestionsProperty
Identifies the CanFilterSuggestions Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty CanFilterSuggestionsProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
DisplayMemberPathProperty
Identifies the DisplayMemberPath Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty DisplayMemberPathProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
DropDownWidthProperty
Identifies the DropDownWidth dependency property.
Declaration
public static readonly BindableProperty DropDownWidthProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
IsEditableProperty
Identifies the IsEditableMode Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty IsEditableProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
ItemsSourceProperty
Identifies the ItemsSource Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty ItemsSourceProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
ItemsSourceSelectorProperty
Identifies the ItemsSourceSelector dependency property.
Declaration
public static readonly BindableProperty ItemsSourceSelectorProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
The identifier for the ItemsSourceSelector dependency property.
ShowClearButtonProperty
Identifies the ShowClearButton Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty ShowClearButtonProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
SuggestionModeProperty
Identifies the SuggestionMode Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty SuggestionModeProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
ValueMemberPathProperty
Identifies the ValueMemberPath Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty ValueMemberPathProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
Properties
AutoCompleteMode
Gets or sets AutoCompleteMode that displays suggestions in several ways.
Declaration
public ComboBoxMode AutoCompleteMode { get; set; }
Property Value
Type | Description |
---|---|
ComboBoxMode | The default value is Suggest. |
Examples
GridComboBoxColumn comboBoxColumn = new GridComboBoxColumn()
{
MappingName = "OrderID",
DisplayMemberPath = "EmployeeID",
ValueMemberPath = "OrderID",
ItemsSource = viewmodel.comboBoxInfo,
CanFilterSuggestions = true,
AutoCompleteMode = Suggest
};
dataGrid.Columns.Add(comboBoxColumn);
CanFilterSuggestions
Gets or sets a value indicating whether the auto complete suggestions can be filtered or not in the GridComboBoxColumn.
Declaration
public bool CanFilterSuggestions { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value is false. |
Examples
GridComboBoxColumn comboBoxColumn = new GridComboBoxColumn()
{
MappingName = "OrderID",
DisplayMemberPath = "EmployeeID",
ValueMemberPath = "OrderID",
ItemsSource = viewmodel.comboBoxInfo
CanFilterSuggestions = false
};
dataGrid.Columns.Add(comboBoxColumn);
DisplayMemberPath
Gets or sets the display member path that associates the column with a property in the data source. The property of the collection bound to the display member path will be the Content of the grid cell in normal and editing mode. The value will be displayed in the grid cell only when the MappingName is equal to the ValueMemberPath, else the grid cell will be blank. But the value corresponding to the given property in the data source will be displayed in the picker in edit mode.
Declaration
public string DisplayMemberPath { get; set; }
Property Value
Type | Description |
---|---|
System.String | The display member path that associates the column with a property in the data source. |
Examples
GridComboBoxColumn comboBoxColumn = new GridComboBoxColumn()
{
MappingName = "OrderID",
DisplayMemberPath = "EmployeeID",
ValueMemberPath = "OrderID",
ItemsSource = viewmodel.comboBoxInfo
};
dataGrid.Columns.Add(comboBoxColumn);
DropDownWidth
Gets or sets a value that indicates the width of the drop down of the GridComboBox when entering edit mode.
Declaration
public int DropDownWidth { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The default value is -1/>. |
Examples
GridComboBoxColumn comboBoxColumn = new GridComboBoxColumn()
{
MappingName = "OrderID",
DisplayMemberPath = "EmployeeID",
ValueMemberPath = "OrderID",
ItemsSource = viewmodel.comboBoxInfo,
CanFilterSuggestions = true,
DropDownWidth = 500
};
dataGrid.Columns.Add(comboBoxColumn);
IsEditableMode
Gets or sets a value indicating whether the user can edit the cell value by typing through editor of GridComboBoxColumn.
Declaration
public bool IsEditableMode { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true if the cell value is edited by typing through the editor of GridComboBoxColumn ; otherwise , false. The default value is false . |
ItemsSource
Gets or sets a collection used to generate the content of GridComboBoxColumn.
Declaration
public IEnumerable<object> ItemsSource { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.Object> | The collection that is used to generate the content of GridComboBoxColumn. The default value is null. |
ItemsSourceSelector
Gets or Sets the different itemsSource for each row in GridComboBoxColumn.
Declaration
public IItemsSourceSelector ItemsSourceSelector { get; set; }
Property Value
Type | Description |
---|---|
IItemsSourceSelector | The itemsSourceSelector that is used to bind a different itemsSource for each row in GridComboBoxColumn. |
ShowClearButton
Gets or sets a value indicating whether to display the clear text button when the grid cell of the comboBox column enters edit mode in UWP platform.
Declaration
public bool ShowClearButton { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | A bool value that determines whether to display the clear text button when the grid cell of the comboBox column enters edit mode in UWP platform. |
Examples
GridComboBoxColumn comboBoxColumn = new GridComboBoxColumn()
{
MappingName = "OrderID",
DisplayMemberPath = "EmployeeID",
ValueMemberPath = "OrderID",
ItemsSource = viewmodel.comboBoxInfo
ShowClearButton = false
};
dataGrid.Columns.Add(comboBoxColumn);
SuggestionMode
Gets or sets SuggestionMode to filter suggestions.
Declaration
public SuggestionMode SuggestionMode { get; set; }
Property Value
Type | Description |
---|---|
SuggestionMode | The default value is StartsWith. |
Examples
GridComboBoxColumn comboBoxColumn = new GridComboBoxColumn()
{
MappingName = "OrderID",
DisplayMemberPath = "EmployeeID",
ValueMemberPath = "OrderID",
ItemsSource = viewmodel.comboBoxInfo,
CanFilterSuggestions = true,
SuggestionMode = StartsWith
};
dataGrid.Columns.Add(comboBoxColumn);
ValueMemberPath
Gets or sets the value member path of the GridComboBoxColumn that associates the column with a property in the data source. The column in the Columns collection whose MappingName is equal to the value member path, will be updated with the corresponding value for the selected item in the picker, when editing in the GridComboBox is ended.
Declaration
public string ValueMemberPath { get; set; }
Property Value
Type | Description |
---|---|
System.String | The value member path that associates the column with a property in the data source. |
Examples
GridComboBoxColumn comboBoxColumn = new GridComboBoxColumn()
{
MappingName = "OrderID",
DisplayMemberPath = "EmployeeID",
ValueMemberPath = "OrderID",
ItemsSource = viewmodel.comboBoxInfo
};
dataGrid.Columns.Add(comboBoxColumn);
Methods
GetFormattedValue(Object)
Gets the Formatted value for the Content of a record cell in the column based on the Format and CultureInfo of the column.
Declaration
public override object GetFormattedValue(object value)
Parameters
Type | Name | Description |
---|---|---|
System.Object | value | The actual value of the record cell in the column. |
Returns
Type | Description |
---|---|
System.Object | The formatted value based on the Format and CultureInfo properties of the column. |
Overrides
SetDisplayBindingConverter()
Sets the converter for the DisplayBinding of column.
Declaration
protected override void SetDisplayBindingConverter()