Interface IGridCellRenderer<T>
Provides the functionality for all cell renderer in a SfDataGrid.
Inherited Members
Namespace: Syncfusion.WinForms.DataGrid.Renderers
Assembly: Syncfusion.SfDataGrid.WinForms.dll
Syntax
public interface IGridCellRenderer<T> : IDisposable where T : TableControl
Type Parameters
Name | Description |
---|---|
T | The type of the cell renderer. |
Properties
CurrentCellRendererElement
Gets the editor control of CurrentCell.
Declaration
Control CurrentCellRendererElement { get; }
Property Value
Type |
---|
System.Windows.Forms.Control |
HasCurrentCellState
Gets a value indicating whether the current cell state is maintained.
Declaration
bool HasCurrentCellState { get; }
Property Value
Type |
---|
System.Boolean |
IsEditable
Gets or sets a value indicating whether the current cell is editable or not.
Declaration
bool IsEditable { get; set; }
Property Value
Type |
---|
System.Boolean |
IsFocusable
Gets or sets a value indicating whether the cell is focusible or not.
Declaration
bool IsFocusable { get; set; }
Property Value
Type |
---|
System.Boolean |
TableControl
Gets or sets the TableControl of the cell renderer.
Declaration
T TableControl { get; set; }
Property Value
Type |
---|
T |
Methods
BeginEdit(DataColumnBase, RowColumnIndex)
Begins the editing of the cell with editor control.
Declaration
bool BeginEdit(DataColumnBase column, RowColumnIndex cellRowColumnIndex)
Parameters
Type | Name | Description |
---|---|---|
DataColumnBase | column | The DataColumnBase. |
RowColumnIndex | cellRowColumnIndex | The current cell row and column index. |
Returns
Type | Description |
---|---|
System.Boolean | Returns the result of current cell begin editing. |
CanValidate()
Determines whether the cell validation is allowed. Implement this method to allow cell validation in particular renderer.
Declaration
bool CanValidate()
Returns
Type | Description |
---|---|
System.Boolean | Returns true if the cell validation is allowed. |
EndEdit(DataColumnBase, RowColumnIndex)
Ends the editing of the cell.
Declaration
bool EndEdit(DataColumnBase column, RowColumnIndex cellRowColumnIndex)
Parameters
Type | Name | Description |
---|---|---|
DataColumnBase | column | The DataColumnBase. |
RowColumnIndex | cellRowColumnIndex | The current cell row and column index. |
Returns
Type | Description |
---|---|
System.Boolean | Returns the result of the end editing of the cell. |
GetControlValue()
Gets the control value of the cell.
Declaration
object GetControlValue()
Returns
Type | Description |
---|---|
System.Object | Returns the control value of the cell. |
KeyDown(DataColumnBase, RowColumnIndex, KeyEventArgs)
Occurs when the key is pressed while the cell has focus.
Declaration
void KeyDown(DataColumnBase dataColumn, RowColumnIndex rowColumnIndex, KeyEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
DataColumnBase | dataColumn | The DataColumnBase of the cell. |
RowColumnIndex | rowColumnIndex | The row and column index of the cell. |
System.Windows.Forms.KeyEventArgs | e | The System.Windows.Forms.KeyEventArgs that contains the event data. |
KeyPress(DataColumnBase, RowColumnIndex, KeyPressEventArgs)
Occurs when the key is pressed while the cell has focus.
Declaration
void KeyPress(DataColumnBase dataColumn, RowColumnIndex rowColumnIndex, KeyPressEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
DataColumnBase | dataColumn | The DataColumnBase of the cell. |
RowColumnIndex | rowColumnIndex | The row and column index of the cell. |
System.Windows.Forms.KeyPressEventArgs | e | The System.Windows.Forms.KeyEventArgs that contains the event data. |
KeyUp(DataColumnBase, RowColumnIndex, KeyEventArgs)
Occurs when the key is released while the cell has focus.
Declaration
void KeyUp(DataColumnBase dataColumn, RowColumnIndex rowColumnIndex, KeyEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
DataColumnBase | dataColumn | The DataColumnBase of the cell. |
RowColumnIndex | rowColumnIndex | The row and column index of the cell. |
System.Windows.Forms.KeyEventArgs | e | The System.Windows.Forms.KeyEventArgs that contains the event data. |
MouseDoubleClick(DataColumnBase, RowColumnIndex, MouseEventArgs)
Occurs when the mouse button is double clicked on the cell.
Declaration
void MouseDoubleClick(DataColumnBase dataColumn, RowColumnIndex rowColumnIndex, MouseEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
DataColumnBase | dataColumn | The DataColumnBase of the cell. |
RowColumnIndex | rowColumnIndex | The RowColumnIndex of the cell. |
System.Windows.Forms.MouseEventArgs | e | The System.Windows.Forms.MouseEventArgs contains the event data. |
MouseDown(DataColumnBase, RowColumnIndex, MouseEventArgs)
Occurs when the mouse pointer is over the cell and a mouse button is pressed.
Declaration
void MouseDown(DataColumnBase dataColumn, RowColumnIndex rowColumnIndex, MouseEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
DataColumnBase | dataColumn | The DataColumnBase of the cell. |
RowColumnIndex | rowColumnIndex | The row and column index of the cell. |
System.Windows.Forms.MouseEventArgs | e | The System.Windows.Forms.MouseEventArgs contains the event data. |
MouseHover(DataColumnBase, RowColumnIndex, MouseEventArgs)
Occurs when the mouse pointer rests on the cell.
Declaration
void MouseHover(DataColumnBase dataColumn, RowColumnIndex rowColumnIndex, MouseEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
DataColumnBase | dataColumn | The DataColumnBase of the cell. |
RowColumnIndex | rowColumnIndex | The row and column index of the cell. |
System.Windows.Forms.MouseEventArgs | e | The System.Windows.Forms.MouseEventArgs contains the event data. |
MouseHoverLeave(DataColumnBase, RowColumnIndex, MouseEventArgs)
Occurs when the mouse leaves the cell.
Declaration
void MouseHoverLeave(DataColumnBase dataColumn, RowColumnIndex rowColumnIndex, MouseEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
DataColumnBase | dataColumn | The DataColumnBase of the cell. |
RowColumnIndex | rowColumnIndex | RowColumnIndex of the cell from which the mouse leaves. |
System.Windows.Forms.MouseEventArgs | e | The System.Windows.Forms.MouseEventArgs contains the event data. |
MouseMove(DataColumnBase, RowColumnIndex, MouseEventArgs)
Occurs when the mouse pointer is moved over the cell.
Declaration
void MouseMove(DataColumnBase dataColumn, RowColumnIndex rowColumnIndex, MouseEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
DataColumnBase | dataColumn | The DataColumnBase of the cell. |
RowColumnIndex | rowColumnIndex | The row and column index of the cell. |
System.Windows.Forms.MouseEventArgs | e | The System.Windows.Forms.MouseEventArgs contains the event data. |
MouseUp(DataColumnBase, RowColumnIndex, MouseEventArgs)
Occurs when the mouse pointer is over on the cell and a mouse button is released.
Declaration
void MouseUp(DataColumnBase dataColumn, RowColumnIndex rowColumnIndex, MouseEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
DataColumnBase | dataColumn | The DataColumnBase of the cell. |
RowColumnIndex | rowColumnIndex | The RowColumnIndex of the cell. |
System.Windows.Forms.MouseEventArgs | e | The System.Windows.Forms.MouseEventArgs contains the event data. |
OnDrawCurrentCell(Graphics, SfDataGrid, RowColumnIndex)
Draw the current cell
Declaration
void OnDrawCurrentCell(Graphics graphics, SfDataGrid dataGrid, RowColumnIndex currentCellRowColumnIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Graphics | graphics | The System.Drawing.Graphics that used to draw the cell. |
SfDataGrid | dataGrid | The DataGrid. |
RowColumnIndex | currentCellRowColumnIndex | The row column index of the current cell. |
Render(Graphics, Rectangle, String, CellStyleInfo, DataColumnBase, RowColumnIndex)
Draws the cell.
Declaration
void Render(Graphics paint, Rectangle cellRect, string cellValue, CellStyleInfo style, DataColumnBase column, RowColumnIndex rowColumnIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Graphics | paint | The System.Drawing.Graphics that used to draw the cell. |
System.Drawing.Rectangle | cellRect | The bounds of the cell. |
System.String | cellValue | The value of the cell. |
CellStyleInfo | style | The CellStyleInfo of the cell. |
DataColumnBase | column | The DataColumnBase of the cell. |
RowColumnIndex | rowColumnIndex | The row and column index of the cell. |
ResetCurrentCellState()
Resets the current cell state to default.
Declaration
void ResetCurrentCellState()
SetControlValue(Object)
Sets the control value of the cell.
Declaration
void SetControlValue(object value)
Parameters
Type | Name | Description |
---|---|---|
System.Object | value | The control value of the cell. |
SetCurrentCellState(RowColumnIndex, Control, Boolean, Boolean)
Sets the current cell state.
Declaration
void SetCurrentCellState(RowColumnIndex currentCellIndex, Control currentCellElement, bool isInEditing, bool isFocused)
Parameters
Type | Name | Description |
---|---|---|
RowColumnIndex | currentCellIndex | The current cell row and column index. |
System.Windows.Forms.Control | currentCellElement | The editor control of the current cell. |
System.Boolean | isInEditing | The value indicating whether the cell is in editing or not. |
System.Boolean | isFocused | The value indicating whether the cell is focused or not. |
SetFocus(Boolean)
Sets the focus to the edit control of the current cell.
Declaration
void SetFocus(bool needToFocus)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | needToFocus | Specifies whether the current cell edit control is focusable or not. |
UnloadUIElement()
Unloads the editor control.
Declaration
void UnloadUIElement()