Class GridCellRendererBase
The GridCellRendererBase class provides a default implementation of the IGridCellRenderer interface for a cell renderer. You should derive from this class to implement custom cell renderer classes. There is however no dependency on GridCellRendererBase inside of the control.
If you want to implement a renderer with support for live views inside the cell you should derive from the GridVirtualizingCellRendererBase<T1, T2> or grid adapted VirtualizingCellRendererBase classes.
Namespace: Syncfusion.SfDataGrid
Assembly: Syncfusion.SfDataGrid.iOS.dll
Syntax
public class GridCellRendererBase : Object, IGridCellRenderer, IDisposable
Constructors
GridCellRendererBase()
Initializes a new instance of the GridCellRendererBase class.
Declaration
public GridCellRendererBase()
Properties
CurrentCellElement
Gets the view of the current cell.
Declaration
public UIView CurrentCellElement { get; }
Property Value
Type | Description |
---|---|
UIKit.UIView | The view of the current cell. |
CurrentCellIndex
Gets or sets the current cell's row column index.
Declaration
public RowColumnIndex CurrentCellIndex { get; }
Property Value
Type | Description |
---|---|
RowColumnIndex | The current cell's row column index. |
CurrentCellRendererElement
Gets the view of the current cell element.
Declaration
public UIView CurrentCellRendererElement { get; }
Property Value
Type | Description |
---|---|
UIKit.UIView | The view of the current cell element. |
DataGrid
Gets or sets the reference of the SfDataGrid control.
Declaration
public SfDataGrid DataGrid { get; set; }
Property Value
Type | Description |
---|---|
SfDataGrid | The reference of the SfDataGrid control. |
HasCurrentCellState
Gets a value indicating whether the cell state for the current cell has been set.
Declaration
public bool HasCurrentCellState { get; }
Property Value
Type | Description |
---|---|
System.Boolean | True if the cell state for the current cell is set, otherwise false. |
IsEditable
Gets or sets a value indicating whether the cell is editable.
Declaration
public bool IsEditable { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | True if the cell is editable, otherwise false. The default value is false. |
IsFocusable
Gets or sets a value indicating whether the grid cell is focusable.
Declaration
public bool IsFocusable { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | True if the current cell is focusable, otherwise false. The default value is true. |
SupportsRenderOptimization
Gets or sets a value indicating whether the renderer supports rendering itself directly to the drawing context. When this is possible the UIElement will only be created when the user moves the mouse over the cell or if the UIElement is needed for other reasons, e.g. animate after change. The benefit of rendering directly to the DrawingContext instead of creating the UIElement is a much improved scrolling performance.
Declaration
public bool SupportsRenderOptimization { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | True if the renderer supports optimization, 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 virtual 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. |
CanUpdateBinding(DataColumnBase)
Determines whether the binding for the column can be updated. Implement this method to update binding on particular renderer when the data context is set.
Declaration
public virtual bool CanUpdateBinding(DataColumnBase dataColumnBase)
Parameters
Type | Name | Description |
---|---|---|
Syncfusion.SfDataGrid.DataColumnBase | dataColumnBase | The corresponding column for which the binding update should be determined. |
Returns
Type | Description |
---|---|
System.Boolean | True if the binding is updated for the column, otherwise false. |
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 virtual void ClearRecycleBin()
CommitCellValue(Boolean)
Commits the edited value to the underlying data.
Declaration
public virtual void CommitCellValue(bool isNewValue)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | isNewValue | A value indicating whether the edited value is new value. |
Dispose()
Releases all resources used by the GridCellRendererBase class.
Declaration
public void Dispose()
Dispose(Boolean)
Releases the unmanaged resources used by the component and optionally releases the managed resources.
Declaration
protected virtual 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. |
EndEdit(DataColumnBase, Object)
This method fires when the editing in the current cell is ended.
Declaration
public virtual bool EndEdit(DataColumnBase dataColumn, object record)
Parameters
Type | Name | Description |
---|---|---|
Syncfusion.SfDataGrid.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. |
Returns
Type | Description |
---|---|
System.Boolean | A boolean value indicating whether the current cell has focus. |
GetControlValue()
Returns the current cell value, only if the renderer's HasCurrentCellState is true.
Declaration
public virtual object GetControlValue()
Returns
Type | Description |
---|---|
System.Object | The current cell value. |
Layout(RowColumnIndex, UIView, nfloat, nfloat, nfloat, nfloat)
Renderer will arrange the views using this method.
Declaration
public void Layout(RowColumnIndex rowColumnIndex, UIView view, nfloat left, nfloat top, nfloat right, nfloat bottom)
Parameters
Type | Name | Description |
---|---|---|
RowColumnIndex | rowColumnIndex | The row column index of the cell. |
UIKit.UIView | view | The corresponding UIElement of the cell. |
System.nfloat | left | The left end of the cell for arranging the view. |
System.nfloat | top | The top end of the cell for arranging the view. |
System.nfloat | right | The right end of the cell for arranging the view. |
System.nfloat | bottom | The bottom end of the cell for arranging the view. |
Measure(RowColumnIndex, UIView, Int32, Int32)
Method which is used by the renderer to measure the cell views.
Declaration
public void Measure(RowColumnIndex rowColumnIndex, UIView view, int widthMeasureSpec, int heightMeasureSpec)
Parameters
Type | Name | Description |
---|---|---|
RowColumnIndex | rowColumnIndex | The row column index of the cell. |
UIKit.UIView | view | The corresponding view of the cell. |
System.Int32 | widthMeasureSpec | Corresponding width for measuring the view size. |
System.Int32 | heightMeasureSpec | Corresponding height for measuring the view size. |
OnLayout(RowColumnIndex, UIView, nfloat, nfloat, nfloat, nfloat)
Called from Layout(RowColumnIndex, UIView, nfloat, nfloat, nfloat, nfloat) to arrange the GridCell's children view(s).
Declaration
protected virtual void OnLayout(RowColumnIndex rowColumnIndex, UIView view, nfloat left, nfloat top, nfloat right, nfloat bottom)
Parameters
Type | Name | Description |
---|---|---|
RowColumnIndex | rowColumnIndex | Row Column Index of the cell |
UIKit.UIView | view | Corresponding UiElement |
System.nfloat | left | left end of the cell for arranging the view |
System.nfloat | top | top value for arranging the view |
System.nfloat | right | right end of the cell for arranging the view |
System.nfloat | bottom | bottom value for arranging the view |
OnMeasure(RowColumnIndex, UIView, Int32, Int32)
Called from Measure(RowColumnIndex, UIView, Int32, Int32) to Measure the GridCell's children view(s).
Declaration
protected virtual void OnMeasure(RowColumnIndex rowColumnIndex, UIView view, int widthMeasureSpec, int heightMeasureSpec)
Parameters
Type | Name | Description |
---|---|---|
RowColumnIndex | rowColumnIndex | Row Column Index of the cell |
UIKit.UIView | view | Corresponding view |
System.Int32 | widthMeasureSpec | Corresponding width for measuring the view size |
System.Int32 | heightMeasureSpec | Corresponding height for measuring the view size |
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 virtual 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 |
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 virtual void OnRefreshDisplayValue(DataColumnBase dataColumn)
Parameters
Type | Name | Description |
---|---|---|
Syncfusion.SfDataGrid.DataColumnBase | dataColumn | The dataColumn containing the details of the column. |
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 virtual void OnUnloadViews(DataColumnBase dataColumn)
Parameters
Type | Name | Description |
---|---|---|
Syncfusion.SfDataGrid.DataColumnBase | dataColumn | The dataColumn containing the details of the column. |
OnUpdateCellStyle(DataColumnBase)
Called from UpdateCellStyle(DataColumnBase) to update the cell style for the column element in a Syncfusion.SfDataGrid.DataColumn.
Declaration
protected virtual void OnUpdateCellStyle(DataColumnBase dataColumn)
Parameters
Type | Name | Description |
---|---|---|
Syncfusion.SfDataGrid.DataColumnBase | dataColumn | The data column. |
OnUpdateCellValue(DataColumnBase)
Called from UpdateCellValue(DataColumnBase) to update the cell value of the column element.
Declaration
protected virtual void OnUpdateCellValue(DataColumnBase dataColumn)
Parameters
Type | Name | Description |
---|---|---|
Syncfusion.SfDataGrid.DataColumnBase | dataColumn | The data column. |
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 virtual void OnUpdateColumnInfo(DataColumnBase dataColumn)
Parameters
Type | Name | Description |
---|---|---|
Syncfusion.SfDataGrid.DataColumnBase | dataColumn | The dataColumn containing the details of the column. |
PrepareViews(DataColumnBase)
Method which is used to create and initiate the view for the cell.
Declaration
public CellElement PrepareViews(DataColumnBase dataColumn)
Parameters
Type | Name | Description |
---|---|---|
Syncfusion.SfDataGrid.DataColumnBase | dataColumn | The dataColumn containing the details of the column. |
Returns
Type | Description |
---|---|
CellElement | Returns the view of the cell. |
RefreshDisplayValue(DataColumnBase)
Method which is used to refresh the display value of the Cell.
Declaration
public void RefreshDisplayValue(DataColumnBase dataColumn)
Parameters
Type | Name | Description |
---|---|---|
Syncfusion.SfDataGrid.DataColumnBase | dataColumn | The dataColumn containing the details of the column. |
ResetCurrentCellState()
Resets the current cell information in renderer, when the current cell is deactivated.
Declaration
public void ResetCurrentCellState()
SetControlValue(Object)
Set the current cell value, only if the renderer's HasCurrentCellState is true.
Declaration
public virtual void SetControlValue(object value)
Parameters
Type | Name | Description |
---|---|---|
System.Object | value | The value to be set to the current cell. |
SetCurrentCellState(RowColumnIndex, CellElement, Boolean)
Update the current cell information in the renderer while current cell was activated.
Declaration
public void SetCurrentCellState(RowColumnIndex currentCellIndex, CellElement currentCellElement, bool isInEditing)
Parameters
Type | Name | Description |
---|---|---|
RowColumnIndex | currentCellIndex | The row column index of the current cell. |
CellElement | currentCellElement | The UIElement of the current cell. |
System.Boolean | isInEditing | The value indicating whether the view is in edit mode or not. |
SetFocus(Boolean)
Sets the focus to the current cell renderer element.
Declaration
public void SetFocus(bool setFocus)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | setFocus | The value indicating whether the current cell renderer element is focusable or not. |
SetFocus(UIView, Boolean)
Sets the focus for the editing view.
Declaration
protected virtual void SetFocus(UIView view, bool needToFocus)
Parameters
Type | Name | Description |
---|---|---|
UIKit.UIView | view | Current cell renderer element |
System.Boolean | needToFocus | Returns whether focus has to be set or not. |
UnloadViews(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 AllowRecycle was set.
Declaration
public void UnloadViews(DataColumnBase dataColumn)
Parameters
Type | Name | Description |
---|---|---|
Syncfusion.SfDataGrid.DataColumnBase | dataColumn | The dataColumn containing the details of the column. |
UpdateCellStyle(DataColumnBase)
Method used to update the cell style.
Declaration
public void UpdateCellStyle(DataColumnBase dataColumn)
Parameters
Type | Name | Description |
---|---|---|
Syncfusion.SfDataGrid.DataColumnBase | dataColumn | The dataColumn containing the details of the column. |
UpdateCellValue(DataColumnBase)
Method which is used to update the cell value.
Declaration
public void UpdateCellValue(DataColumnBase dataColumn)
Parameters
Type | Name | Description |
---|---|---|
Syncfusion.SfDataGrid.DataColumnBase | dataColumn | The dataColumn containing the details of the column. |
UpdateColumnInfo(DataColumnBase)
Method which is used to Update the Binding Information of the Cell UIElement
Declaration
protected void UpdateColumnInfo(DataColumnBase dataColumn)
Parameters
Type | Name | Description |
---|---|---|
Syncfusion.SfDataGrid.DataColumnBase | dataColumn | The dataColumn containing the details of the column. |
UpdateCurrentCellState(UIView, Boolean)
Updates the current cell state for the specified current cell renderer element.
Declaration
protected void UpdateCurrentCellState(UIView currentRendererElement, bool isInEdit)
Parameters
Type | Name | Description |
---|---|---|
UIKit.UIView | currentRendererElement | Specifies the current cell UIElement to update the current cell state. |
System.Boolean | isInEdit | Specifies whether the current cell is editable. |
Explicit Interface Implementations
IGridCellRenderer.UpdateColumnInfo(DataColumnBase)
Method which is used to Update the Binding Information of the Cell UIElement
Declaration
void IGridCellRenderer.UpdateColumnInfo(DataColumnBase dataColumn)
Parameters
Type | Name | Description |
---|---|---|
Syncfusion.SfDataGrid.DataColumnBase | dataColumn | The dataColumn containing the details of the column. |