Class GridCellSwitchRenderer
GridCellSwitchRenderer is a class for cell renderer that displays SfSwitchControl in a GridCell. The class provides strong typed override methods for initializing Content of the cell and arranging the cell visuals.
Updates to appearance and Content of child elements, creation and unloading of views will not trigger layout or render calls in parent canvas.
Inheritance
Inherited Members
Namespace: Syncfusion.SfDataGrid.XForms
Assembly: Syncfusion.SfDataGrid.XForms.dll
Syntax
public class GridCellSwitchRenderer : GridVirtualizingCellRendererBase<SfSwitchControl, SfSwitchControl>, IGridCellRenderer, IDisposable
Constructors
GridCellSwitchRenderer()
Initializes a new instance of the GridCellSwitchRenderer class.
Declaration
public GridCellSwitchRenderer()
Methods
OnCreateDisplayUIView()
Creates a new SfSwitchControl view.
Declaration
protected override SfSwitchControl OnCreateDisplayUIView()
Returns
Type | Description |
---|---|
SfSwitchControl | A new SfSwitchControl view. |
Overrides
OnInitializeDisplayView(DataColumnBase, SfSwitchControl)
Initializes the column element of a Syncfusion.SfDataGrid.XForms.DataColumn object with the given SfSwitchControl and required values.
Declaration
public override void OnInitializeDisplayView(DataColumnBase dataColumn, SfSwitchControl view)
Parameters
Type | Name | Description |
---|---|---|
Syncfusion.SfDataGrid.XForms.DataColumnBase | dataColumn | The dataColumn containing the details of the column. |
SfSwitchControl | view | A SfSwitchControl view to be hosted inside the column element. |
Overrides
OnUnloadViews(DataColumnBase)
Called from UnloadViews(DataColumnBase) after a cell is scrolled out of view. GridVirtualizingCellRendererBase<T1, T2> overrides this method and either removes the cell renderer visuals from the parent canvas or hide them and reuse it later in same canvas depending on whether AllowRecycle was set.
Declaration
protected override void OnUnloadViews(DataColumnBase dataColumn)
Parameters
Type | Name | Description |
---|---|---|
Syncfusion.SfDataGrid.XForms.DataColumnBase | dataColumn | The dataColumn containing the details of the column. |
Overrides
OnUpdateCellValue(DataColumnBase)
Updates the toggle value of the SfSwitchControl.
Declaration
protected override void OnUpdateCellValue(DataColumnBase dataColumn)
Parameters
Type | Name | Description |
---|---|---|
Syncfusion.SfDataGrid.XForms.DataColumnBase | dataColumn | The data column. |
Overrides
OnUpdateDisplayValue(DataColumnBase, SfSwitchControl)
Updates the column element of a Syncfusion.SfDataGrid.XForms.DataColumn object with the given SfSwitchControl and required values.
Declaration
public override void OnUpdateDisplayValue(DataColumnBase dataColumn, SfSwitchControl view)
Parameters
Type | Name | Description |
---|---|---|
Syncfusion.SfDataGrid.XForms.DataColumnBase | dataColumn | The dataColumn containing the details of the column. |
SfSwitchControl | view | A SfSwitchControl to be updated inside the column element. |