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
Inherited Members
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
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
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
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
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
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
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
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
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
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
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
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 |