Interface IGridCellRenderer
Defines the interface for all cell renderer. A default implementation of this interface is provided by the GridCellRendererBase class from which you should derive custom cell renderer classes. There is however no dependency on GridCellRendererBase. We should access the renderer by using this interface only. Do not create any objects for renderer.
Namespace: Syncfusion.SfDataGrid.XForms
Assembly: Syncfusion.SfDataGrid.XForms.dll
Syntax
public interface IGridCellRenderer : IDisposable
Properties
DataGrid
Gets or sets the reference of the SfDataGrid control.
Declaration
SfDataGrid DataGrid { get; set; }
Property Value
Type |
---|
SfDataGrid |
HasCurrentCellState
Gets a value indicating whether the cell state for the current cell has been set.
Declaration
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 or not.
Declaration
bool IsEditable { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | True if the current cell is editable, otherwise false. |
IsFocusable
Gets or sets a value indicating whether a grid cell is focusable or not.
Declaration
bool IsFocusable { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | True the current cell is focusable, otherwise false. |
Methods
BeginEdit(RowColumnIndex, CellElement, GridColumn, Object)
This method fires when editing in the current cell begins.
Declaration
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
bool CanUpdateBinding(DataColumnBase dataColumnBase)
Parameters
Type | Name | Description |
---|---|---|
Syncfusion.SfDataGrid.XForms.DataColumnBase | dataColumnBase | The corresponding column for which the binding update should be determined. |
Returns
Type | Description |
---|---|
System.Boolean | Returns 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
void ClearRecycleBin()
CommitCellValue(Boolean)
Commits the edited value to the underlying data.
Declaration
void CommitCellValue(bool isNewValue)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | isNewValue | A value indicating whether the edited value is new value. |
EndEdit(DataColumnBase, Object, Boolean)
This method fires when the editing in the current cell is ended.
Declaration
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. |
GetControlValue()
Returns the current cell value, only if the renderer's HasCurrentCellState is true.
Declaration
object GetControlValue()
Returns
Type | Description |
---|---|
System.Object | The current cell value. |
PrepareViews(DataColumnBase)
Method which is used to create and initiate the view for cell.
Declaration
CellElement PrepareViews(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. |
RefreshDisplayValue(DataColumnBase)
Method which is used to refresh the display value of the cell.
Declaration
void RefreshDisplayValue(DataColumnBase dataColumn)
Parameters
Type | Name | Description |
---|---|---|
Syncfusion.SfDataGrid.XForms.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
void ResetCurrentCellState()
SetCellStyle(DataColumnBase)
Method used to set the CellStyle.
Declaration
void SetCellStyle(DataColumnBase dataColumn)
Parameters
Type | Name | Description |
---|---|---|
Syncfusion.SfDataGrid.XForms.DataColumnBase | dataColumn | The dataColumn containing the details of the column. |
SetControlValue(Object)
Set the current cell value, only if the renderer's HasCurrentCellState is true.
Declaration
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
void SetCurrentCellState(RowColumnIndex currentCellIndex, CellElement currentCellElement, bool isInEdit)
Parameters
Type | Name | Description |
---|---|---|
RowColumnIndex | currentCellIndex | The row column index of the current cell. |
CellElement | currentCellElement | The UIElement of the current cell. |
System.Boolean | isInEdit | The value indicating whether the view is in edit mode or not. |
SetFocus(Boolean)
Sets the focus to the current cell renderer element.
Declaration
void SetFocus(bool setFocus)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | setFocus | The value indicating whether the current cell renderer element is focusable or not. |
UnloadViews(DataColumnBase)
Method which is used for Unloading the view of the cell.(For Recycling Purpose).
Declaration
void UnloadViews(DataColumnBase dataColumn)
Parameters
Type | Name | Description |
---|---|---|
Syncfusion.SfDataGrid.XForms.DataColumnBase | dataColumn | The dataColumn containing the details of the column. |
UpdateCellStyle(DataColumnBase)
Method used to update the cell style.
Declaration
void UpdateCellStyle(DataColumnBase dataColumn)
Parameters
Type | Name | Description |
---|---|---|
Syncfusion.SfDataGrid.XForms.DataColumnBase | dataColumn | The dataColumn containing the details of the column. |
UpdateCellValue(DataColumnBase)
Method which is used to update the cell value.
Declaration
void UpdateCellValue(DataColumnBase dataColumn)
Parameters
Type | Name | Description |
---|---|---|
Syncfusion.SfDataGrid.XForms.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
void UpdateColumnInfo(DataColumnBase dataColumn)
Parameters
Type | Name | Description |
---|---|---|
Syncfusion.SfDataGrid.XForms.DataColumnBase | dataColumn | The dataColumn containing the details of the column. |