menu

Xamarin.Forms

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class GridVirtualizingCellRendererBase<T1, T2> - Xamarin.Forms API Reference | Syncfusion

    Show / Hide Table of Contents

    Class GridVirtualizingCellRendererBase<T1, T2>

    VirtualizingCellRendererBase is an abstract base class for cell renderer classes that need live views displayed in a cell. You can derive from this class and provide the type of the view you want to show inside cells as type parameter. The class provides strong typed virtual methods for initializing Content of the cell and arranging the cell visuals.

    The class manages the creation of cells view objects when the cell is scrolled into view and also unloading of the views. The class offers an optimization in which Views can be recycled when AllowRecycle is set. In this case when a cell is scrolled out of view it is moved into a recycle bin and the next time a new view is scrolled into view the element is recovered from the recycle bin and reinitialized with the new Content of the cell.

    Updates to appearance and Content of child elements, creation and unloading of views will not trigger layout or render calls in parent canvas.

    Inheritance
    System.Object
    GridCellRendererBase
    GridVirtualizingCellRendererBase<T1, T2>
    GridCaptionSummaryCellRenderer
    GridCellSwitchRenderer
    GridCellTemplateRenderer
    GridGroupSummaryCellRenderer
    GridHeaderCellRenderer
    GridImageCellRenderer
    GridRowHeaderCellRenderer
    GridStackedHeaderCellRenderer
    GridTableSummaryCellRenderer
    GridVirtualizingCellRenderer<T1, T2>
    Implements
    IGridCellRenderer
    System.IDisposable
    Inherited Members
    GridCellRendererBase.CanUpdateBinding(DataColumnBase)
    GridCellRendererBase.CurrentCellElement
    GridCellRendererBase.CurrentCellIndex
    GridCellRendererBase.CurrentCellRendererElement
    GridCellRendererBase.DataGrid
    GridCellRendererBase.Dispose()
    GridCellRendererBase.GetControlValue()
    GridCellRendererBase.HasCurrentCellState
    GridCellRendererBase.IGridCellRenderer.UpdateColumnInfo(DataColumnBase)
    GridCellRendererBase.IsEditable
    GridCellRendererBase.IsFocusable
    GridCellRendererBase.OnUpdateCellValue(DataColumnBase)
    GridCellRendererBase.PrepareViews(DataColumnBase)
    GridCellRendererBase.RefreshDisplayValue(DataColumnBase)
    GridCellRendererBase.ResetCurrentCellState()
    GridCellRendererBase.SetCellStyle(DataColumnBase)
    GridCellRendererBase.SetControlValue(Object)
    GridCellRendererBase.SetCurrentCellState(RowColumnIndex, CellElement, Boolean)
    GridCellRendererBase.SetFocus(Boolean)
    GridCellRendererBase.SetFocus(View, Boolean)
    GridCellRendererBase.SupportsRenderOptimization
    GridCellRendererBase.UnloadViews(DataColumnBase)
    GridCellRendererBase.UpdateCellStyle(DataColumnBase)
    GridCellRendererBase.UpdateCellValue(DataColumnBase)
    GridCellRendererBase.UpdateColumnInfo(DataColumnBase)
    GridCellRendererBase.UpdateCurrentCellState(View, Boolean)
    Namespace: Syncfusion.SfDataGrid.XForms
    Assembly: Syncfusion.SfDataGrid.XForms.dll
    Syntax
    public abstract class GridVirtualizingCellRendererBase<T1, T2> : GridCellRendererBase, IGridCellRenderer, IDisposable where T1 : View where T2 : View
    Type Parameters
    Name Description
    T1

    The type of the UIElement that should be placed inside cells in display mode.

    T2

    The type of the UIElement that should be placed inside cells in edit mode.

    Constructors

    GridVirtualizingCellRendererBase()

    Initializes a new instance of the GridVirtualizingCellRendererBase<T1, T2> class.

    Declaration
    protected GridVirtualizingCellRendererBase()

    Fields

    displayRecycleBin

    Recycles the display view elements for cells that were scrolled out of view.

    Declaration
    protected VirtualizingCellUIElementBin<T1> displayRecycleBin
    Field Value
    Type
    Syncfusion.SfDataGrid.XForms.VirtualizingCellUIElementBin<T1>

    editRecycleBin

    Recycles the edit view elements for cells that were scrolled out of view.

    Declaration
    protected VirtualizingCellUIElementBin<T2> editRecycleBin
    Field Value
    Type
    Syncfusion.SfDataGrid.XForms.VirtualizingCellUIElementBin<T2>

    Properties

    AllowRecycle

    Gets or sets a value indicating whether views can be recycled when scrolled out of view. In this case when a cell is scrolled out of view it is moved into a recycle bin and the next time a new element is scrolled into view the element is recovered from the recycle bin and reinitialized with the new Content of the cell.

    Declaration
    public bool AllowRecycle { get; set; }
    Property Value
    Type Description
    System.Boolean

    True if elements can be recycled when scrolled out of view, otherwise false. The default value is true.

    Methods

    BeginEdit(RowColumnIndex, CellElement, GridColumn, Object)

    This method fires when editing in the current cell begins.

    Declaration
    public override bool BeginEdit(RowColumnIndex rowColumnIndex, CellElement cellElement, GridColumn column, object rowData)
    Parameters
    Type Name Description
    RowColumnIndex rowColumnIndex

    The row column index of the cell which is in edit mode.

    CellElement cellElement

    The UIElement of the cell which is in edit mode.

    GridColumn column

    The corresponding grid column of the cell which is in edit mode.

    System.Object rowData

    The corresponding record of the row which is in edit mode.

    Returns
    Type Description
    System.Boolean

    Returns a value indicating whether the cell enters into the editing mode or not.

    Overrides
    GridCellRendererBase.BeginEdit(RowColumnIndex, CellElement, GridColumn, Object)

    ClearRecycleBin()

    Clears the recycle bin. The cell element will be stored for recycling purpose, when the cell element is scrolled out of view. This method clears all the cell elements which are stored for recycling purpose.

    Declaration
    public override void ClearRecycleBin()
    Overrides
    GridCellRendererBase.ClearRecycleBin()
    Remarks

    This method clears both the display recycle bin which stores the display cell elements and edit recycle bin which stores the edit cell elements.

    CommitCellValue(Boolean)

    Commits the edited value to the underlying data.

    Declaration
    public override void CommitCellValue(bool isNewValue)
    Parameters
    Type Name Description
    System.Boolean isNewValue

    A value indicating whether the edited value is new value.

    Overrides
    GridCellRendererBase.CommitCellValue(Boolean)

    Dispose(Boolean)

    Releases the unmanaged resources used by the component and optionally releases the managed resources.

    Declaration
    protected override void Dispose(bool disposing)
    Parameters
    Type Name Description
    System.Boolean disposing

    if true - release both managed and unmanaged resources; if false - release only unmanaged resources.

    Overrides
    GridCellRendererBase.Dispose(Boolean)

    EndEdit(DataColumnBase, Object, Boolean)

    This method fires when the editing in the current cell is ended.

    Declaration
    public override bool EndEdit(DataColumnBase dataColumn, object record, bool canResetBinding = false)
    Parameters
    Type Name Description
    Syncfusion.SfDataGrid.XForms.DataColumnBase dataColumn

    The corresponding data column of the cell, which leaves the edit mode.

    System.Object record

    The underlying data of the cell, which leaves the edit mode.

    System.Boolean canResetBinding

    The value indicating whether to reset the binding or not.

    Returns
    Type Description
    System.Boolean

    A boolean value indicating whether the current cell has focus.

    Overrides
    GridCellRendererBase.EndEdit(DataColumnBase, Object, Boolean)

    InitializeDisplayView(DataColumnBase, T1)

    Initializes the column element of a Syncfusion.SfDataGrid.XForms.DataColumn object with the given view and required values.

    Declaration
    public void InitializeDisplayView(DataColumnBase dataColumn, T1 view)
    Parameters
    Type Name Description
    Syncfusion.SfDataGrid.XForms.DataColumnBase dataColumn

    The data column containing the details of the column.

    T1 view

    The child view to be hosted inside the column element.

    InitializeEditView(DataColumnBase, T2)

    Initializes the edit column element of a Syncfusion.SfDataGrid.XForms.DataColumn object with the given view and required values.

    Declaration
    public void InitializeEditView(DataColumnBase dataColumn, T2 view)
    Parameters
    Type Name Description
    Syncfusion.SfDataGrid.XForms.DataColumnBase dataColumn

    The data column containing the details of the column.

    T2 view

    The child view to be hosted inside the column element.

    OnCreateDisplayUIView()

    Creates a new display view based on the type parameter.

    Declaration
    protected virtual T1 OnCreateDisplayUIView()
    Returns
    Type Description
    T1

    A view of type given in the type parameter.

    OnCreateEditUIView()

    Creates a new view for the edit mode of cell.

    Declaration
    protected virtual T2 OnCreateEditUIView()
    Returns
    Type Description
    T2

    Returns the new view for edit mode of cell.

    OnEnteredEditMode(DataColumnBase, View)

    Invoked when the cell is being entered on the edit mode.

    Declaration
    protected virtual void OnEnteredEditMode(DataColumnBase dataColumn, View currentRendererElement)
    Parameters
    Type Name Description
    Syncfusion.SfDataGrid.XForms.DataColumnBase dataColumn

    The corresponding data column being entered on the edit mode.

    Xamarin.Forms.View currentRendererElement

    The corresponding renderer element in edit mode.

    OnInitializeDisplayView(DataColumnBase, T1)

    Initializes the column element of a Syncfusion.SfDataGrid.XForms.DataColumn object with the given view and required values.

    Declaration
    public abstract void OnInitializeDisplayView(DataColumnBase dataColumn, T1 view)
    Parameters
    Type Name Description
    Syncfusion.SfDataGrid.XForms.DataColumnBase dataColumn

    The data column containing the details of the column.

    T1 view

    The child view to be hosted inside the column element.

    OnInitializeEditView(DataColumnBase, T2)

    Initializes the edit column element of a Syncfusion.SfDataGrid.XForms.DataColumn object with the given view and required values.

    Declaration
    public virtual void OnInitializeEditView(DataColumnBase dataColumn, T2 view)
    Parameters
    Type Name Description
    Syncfusion.SfDataGrid.XForms.DataColumnBase dataColumn

    The data column containing the details of the column.

    T2 view

    The child view to be hosted inside the column element.

    OnLayout(RowColumnIndex, View, Int32, Int32, Int32, Int32)

    Called from the parent to arrange the GridCell's children view(s).

    Declaration
    protected override void OnLayout(RowColumnIndex rowColumnIndex, View view, int left, int top, int right, int bottom)
    Parameters
    Type Name Description
    RowColumnIndex rowColumnIndex

    Row Column Index of the cell.

    Xamarin.Forms.View view

    Corresponding view.

    System.Int32 left

    left end of the cell for arranging the view.

    System.Int32 top

    top value for arranging the view.

    System.Int32 right

    right end of the cell for arranging the view.

    System.Int32 bottom

    bottom value for arranging the view.

    Overrides
    GridCellRendererBase.OnLayout(RowColumnIndex, View, Int32, Int32, Int32, Int32)

    OnMeasure(RowColumnIndex, View, Int32, Int32)

    Called from the parent to Measure the GridCell's children view(s).

    Declaration
    protected override void OnMeasure(RowColumnIndex rowColumnIndex, View view, int widthMeasureSpec, int heightMeasureSpec)
    Parameters
    Type Name Description
    RowColumnIndex rowColumnIndex

    Row Column Index of the cell.

    Xamarin.Forms.View view

    Corresponding view.

    System.Int32 widthMeasureSpec

    Corresponding width for measuring the view size.

    System.Int32 heightMeasureSpec

    Corresponding height for measuring the view size.

    Overrides
    GridCellRendererBase.OnMeasure(RowColumnIndex, View, Int32, Int32)

    OnPrepareViews(DataColumnBase)

    Called from PrepareViews(DataColumnBase) to prepare the GridCell's children view(s). VirtualizingCellRendererBase overrides this method and creates new views and wires them with the parent cells control.

    Declaration
    protected override sealed CellElement OnPrepareViews(DataColumnBase dataColumn)
    Parameters
    Type Name Description
    Syncfusion.SfDataGrid.XForms.DataColumnBase dataColumn

    The DataColumn containing the details of the column.

    Returns
    Type Description
    CellElement

    Returns the columnElement of the cell.

    Overrides
    GridCellRendererBase.OnPrepareViews(DataColumnBase)

    OnRefreshDisplayValue(DataColumnBase)

    Called from RefreshDisplayValue(DataColumnBase) to refresh the display value of the column element.

    Declaration
    protected override void OnRefreshDisplayValue(DataColumnBase dataColumn)
    Parameters
    Type Name Description
    Syncfusion.SfDataGrid.XForms.DataColumnBase dataColumn

    The dataColumn containing the details of the column.

    Overrides
    GridCellRendererBase.OnRefreshDisplayValue(DataColumnBase)

    OnSetCellStyle(DataColumnBase)

    Called from SetCellStyle(DataColumnBase) to set the style for the column element in a Syncfusion.SfDataGrid.XForms.DataColumn.

    Declaration
    protected override void OnSetCellStyle(DataColumnBase dataColumn)
    Parameters
    Type Name Description
    Syncfusion.SfDataGrid.XForms.DataColumnBase dataColumn

    The data column.

    Overrides
    GridCellRendererBase.OnSetCellStyle(DataColumnBase)

    OnUnloadViews(DataColumnBase)

    Called from UnloadViews(DataColumnBase) after a cell is scrolled out of view. VirtualizingCellRendererBase 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 GridVirtualizingCellRendererBase.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
    GridCellRendererBase.OnUnloadViews(DataColumnBase)

    OnUpdateCellStyle(DataColumnBase)

    Called from UpdateCellStyle(DataColumnBase) to update the cell style for the column element in a Syncfusion.SfDataGrid.XForms.DataColumn.

    Declaration
    protected override void OnUpdateCellStyle(DataColumnBase dataColumn)
    Parameters
    Type Name Description
    Syncfusion.SfDataGrid.XForms.DataColumnBase dataColumn

    The data column.

    Overrides
    GridCellRendererBase.OnUpdateCellStyle(DataColumnBase)

    OnUpdateColumnInfo(DataColumnBase)

    Called from UpdateColumnInfo(DataColumnBase) to update the value of the Cell view corresponding to GridColumn. In our control we are reusing the cell views for horizontal scrolling. Hence we need to update the value of the cell view.

    Declaration
    protected override sealed void OnUpdateColumnInfo(DataColumnBase dataColumn)
    Parameters
    Type Name Description
    Syncfusion.SfDataGrid.XForms.DataColumnBase dataColumn

    The dataColumn containing the details of the column.

    Overrides
    GridCellRendererBase.OnUpdateColumnInfo(DataColumnBase)

    OnUpdateDisplayValue(DataColumnBase, T1)

    Updates the column element of a Syncfusion.SfDataGrid.XForms.DataColumn object with the given view and required values.

    Declaration
    public abstract void OnUpdateDisplayValue(DataColumnBase dataColumn, T1 view)
    Parameters
    Type Name Description
    Syncfusion.SfDataGrid.XForms.DataColumnBase dataColumn

    The data column containing the details of the column.

    T1 view

    The child view to be updated inside the column element.

    ResumeBinding(DataColumnBase, T1)

    Resumes the binding value.

    Declaration
    protected virtual void ResumeBinding(DataColumnBase dataColumn, T1 view)
    Parameters
    Type Name Description
    Syncfusion.SfDataGrid.XForms.DataColumnBase dataColumn

    DataColumnBase instance.

    T1 view

    current view.

    SuspendBinding(DataColumnBase, T1)

    Suspends the binding value.

    Declaration
    protected virtual void SuspendBinding(DataColumnBase dataColumn, T1 view)
    Parameters
    Type Name Description
    Syncfusion.SfDataGrid.XForms.DataColumnBase dataColumn

    DataColumnBase instance.

    T1 view

    current view.

    UnwireEditUIElement(T2)

    Unwire the edit element to the view.

    Declaration
    protected virtual void UnwireEditUIElement(T2 editElement)
    Parameters
    Type Name Description
    T2 editElement

    The edit element .

    UpdateColumnElement(DataColumnBase)

    Updates the column element of the passed dataColumn.

    Declaration
    protected virtual CellElement UpdateColumnElement(DataColumnBase dataColumn)
    Parameters
    Type Name Description
    Syncfusion.SfDataGrid.XForms.DataColumnBase dataColumn

    The data column.

    Returns
    Type Description
    CellElement

    The column element.

    UpdateDisplayValue(DataColumnBase, T1)

    Updates the column element of a Syncfusion.SfDataGrid.XForms.DataColumn object with the given view and required values.

    Declaration
    public void UpdateDisplayValue(DataColumnBase dataColumn, T1 view)
    Parameters
    Type Name Description
    Syncfusion.SfDataGrid.XForms.DataColumnBase dataColumn

    The data column containing the details of the column.

    T1 view

    The child view to be updated inside the column element.

    WireEditUIElement(T2)

    Wires the edit element to the view.

    Declaration
    protected virtual void WireEditUIElement(T2 editElement)
    Parameters
    Type Name Description
    T2 editElement

    The edit element.

    Implements

    IGridCellRenderer
    System.IDisposable
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved