Class GridPickerColumn
Represents a SfDataGrid column that hosts Syncfusion.SfDataGrid.XForms.Renderers.GridPicker in its cells.
Implements
Inherited Members
Namespace: Syncfusion.SfDataGrid.XForms
Assembly: Syncfusion.SfDataGrid.XForms.dll
Syntax
public class GridPickerColumn : GridColumn, IDisposable
Remarks
Use GridPickerColumn to display columns of picker data as a Syncfusion.SfDataGrid.XForms.Renderers.GridPicker.
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 Syncfusion.SfDataGrid.XForms.Renderers.GridPicker 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 your data source and target are different types.
Examples
<sfGrid:SfDataGrid.Columns>
<sfgrid:GridPickerColumn BindingContext = "{x:Reference viewModel}"
HeaderText="Dealer Name"
ItemsSource="{Binding CustomerNames}"
MappingName="DealerName"/>
</sfGrid:SfDataGrid.Columns>
Constructors
GridPickerColumn()
Initializes a new instance of the GridPickerColumn class.
Declaration
public GridPickerColumn()
Fields
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.
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.
TitleProperty
Identifies the Title Xamarin.Forms.BindableProperty.
Declaration
public static readonly BindableProperty TitleProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This Xamarin.Forms.BindableProperty is read-only.
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
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
GridPickerColumn pickerColumn = new GridPickerColumn()
{
MappingName = "OrderID",
DisplayMemberPath = "EmployeeID",
ValueMemberPath = "OrderID",
ItemsSource = viewmodel.PickerInfo
};
dataGrid.Columns.Add(pickerColumn);
See Also
ItemsSource
Gets or sets the items source of the GridPickerColumn. The user can create a GridPickerColumn and set its ItemsSource property to a simple collection to display the collection items in the picker drop down.
Declaration
public IList ItemsSource { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.IList | The data source for the picker. |
Examples
GridPickerColumn pickerColumn = new GridPickerColumn()
{
BindingContext = viewModel,
ItemsSource = viewModel.CustomerNames,
};
dataGrid.Columns.Add(pickerColumn);
See Also
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. |
Title
Gets or sets the title of the GridPickerColumn.
Declaration
public string Title { get; set; }
Property Value
Type | Description |
---|---|
System.String | The title of the GridPickerColumn. |
Examples
GridPickerColumn pickerColumn = new GridPickerColumn()
{
BindingContext = viewModel,
ItemsSource = viewModel.CustomerNames,
Title = "Customer Names"
};
dataGrid.Columns.Add(pickerColumn);
ValueMemberPath
Gets or sets the value member path of the GridPickerColumn 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 GridPickerColumn 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
GridPickerColumn pickerColumn = new GridPickerColumn()
{
MappingName = "OrderID",
DisplayMemberPath = "EmployeeID",
ValueMemberPath = "OrderID",
ItemsSource = viewmodel.PickerInfo
};
dataGrid.Columns.Add(pickerColumn);
See Also
Methods
SetDisplayBindingConverter()
Sets the converter for the DisplayBinding of column.
Declaration
protected override void SetDisplayBindingConverter()