menu

Xamarin.Android

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class GridVirtualizingCellRendererBase<T1, T2> - Xamarin.Android 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
    GridGroupSummaryCellRenderer
    GridHeaderCellRenderer
    GridImageCellRenderer
    GridRowHeaderCellRenderer
    GridTableSummaryCellRenderer
    GridVirtualizingCellRenderer<T1, T2>
    Implements
    IGridCellRenderer
    System.IDisposable
    Inherited Members
    GridCellRendererBase.CanUpdateBinding(DataColumnBase)
    GridCellRendererBase.Context
    GridCellRendererBase.CurrentCellElement
    GridCellRendererBase.CurrentCellIndex
    GridCellRendererBase.CurrentCellRendererElement
    GridCellRendererBase.DataGrid
    GridCellRendererBase.Dispose()
    GridCellRendererBase.GetControlValue()
    GridCellRendererBase.HasCurrentCellState
    GridCellRendererBase.IGridCellRenderer.UpdateColumnInfo(DataColumnBase)
    GridCellRendererBase.IsEditable
    GridCellRendererBase.IsFocusable
    GridCellRendererBase.Layout(RowColumnIndex, View, Int32, Int32, Int32, Int32)
    GridCellRendererBase.Measure(RowColumnIndex, View, Int32, Int32)
    GridCellRendererBase.OnUpdateCellStyle(DataColumnBase)
    GridCellRendererBase.OnUpdateCellValue(DataColumnBase)
    GridCellRendererBase.PrepareViews(DataColumnBase)
    GridCellRendererBase.RefreshDisplayValue(DataColumnBase)
    GridCellRendererBase.ResetCurrentCellState()
    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
    Assembly: Syncfusion.SfDataGrid.Android.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 class.

    Declaration
    public GridVirtualizingCellRendererBase()

    Fields

    displayRecycleBin

    The recycle bin which holds the UI which is loaded in the display mode of the cell.

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

    editRecycleBin

    The recycle bin which holds the UI which is loaded in the edit mode of the cell.

    Declaration
    protected VirtualizingCellUIElementBin<T2> editRecycleBin
    Field Value
    Type
    Syncfusion.SfDataGrid.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)

    CreateOrRecycleDisplayUIView()

    Creates a new view or reuses the existing view if reusing can be applied here

    Declaration
    protected virtual T1 CreateOrRecycleDisplayUIView()
    Returns
    Type Description
    T1

    Returns a created new view or reuses the existing view if reusing can be applied here

    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)

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

    Declaration
    public override bool EndEdit(DataColumnBase dataColumnBase, object record)
    Parameters
    Type Name Description
    Syncfusion.SfDataGrid.DataColumnBase dataColumnBase

    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.

    Returns
    Type Description
    System.Boolean

    A boolean value indicating whether the current cell has focus.

    Overrides
    GridCellRendererBase.EndEdit(DataColumnBase, Object)

    InitializeDisplayView(DataColumnBase, T1)

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

    Declaration
    public void InitializeDisplayView(DataColumnBase dataColumn, T1 view)
    Parameters
    Type Name Description
    Syncfusion.SfDataGrid.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.DataColumn object with the given view and required values.

    Declaration
    public void InitializeEditView(DataColumnBase dataColumn, T2 view)
    Parameters
    Type Name Description
    Syncfusion.SfDataGrid.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 UIView and initializes it with the required properties.

    Declaration
    protected virtual T1 OnCreateDisplayUIView()
    Returns
    Type Description
    T1

    The newly created UIView.

    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.DataColumnBase dataColumn

    The corresponding data column being entered on the edit mode.

    Android.Views.View currentRendererElement

    The corresponding renderer element in edit mode.

    OnInitializeDisplayView(DataColumnBase, T1)

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

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

    The data column containing the details of the column.

    T1 view

    A view to be hosted inside the column element.

    OnInitializeEditView(DataColumnBase, T2)

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

    Declaration
    public virtual void OnInitializeEditView(DataColumnBase dataColumn, T2 view)
    Parameters
    Type Name Description
    Syncfusion.SfDataGrid.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 Layout(RowColumnIndex, View, Int32, Int32, Int32, Int32) 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

    Android.Views.View view

    Corresponding UiElement

    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 Measure(RowColumnIndex, View, Int32, Int32) 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

    Android.Views.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.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 update the cell appearance as per the customer need through API's. In our control we are reusing the cell views for scrolling. Hence we need to update the styles of the cell views.

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

    The dataColumn containing the details of the column.

    Overrides
    GridCellRendererBase.OnRefreshDisplayValue(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.DataColumnBase dataColumn

    The dataColumn containing the details of the column.

    Overrides
    GridCellRendererBase.OnUnloadViews(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.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.DataColumn object with the given view and required values.

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

    The data column containing the details of the column.

    T1 view

    A view to be updated inside the column element.

    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.DataColumnBase dataColumn

    Data column.

    Returns
    Type Description
    CellElement

    The column element.

    UpdateDisplayValue(DataColumnBase, T1)

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

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

    The data column containing the details of the column.

    T1 view

    A 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