Class GridCellRendererBase
This is a base class for the renderer part of a cell type.
Inheritance
Inherited Members
Namespace: Syncfusion.Windows.Controls.Grid
Assembly: Syncfusion.Grid.Wpf.dll
Syntax
public class GridCellRendererBase : CellRendererBase<GridRenderStyleInfo>, IGridCellRenderer, ICellRenderer, IDisposable, IHitTestSelectCells, IStyleChanged
Remarks
A renderer is created for each GridCellModelBase and GridControlBase.
You typically access cell renderers through the CellRenderers property of the GridControlBase class.
Constructors
GridCellRendererBase()
Initializes a new GridCellRendererBase.
Declaration
public GridCellRendererBase()
Properties
ActivateOptions
Returns the options to activate the current cell.
Declaration
public GridActivateCurrentCellOptions ActivateOptions { get; }
Property Value
| Type |
|---|
| GridActivateCurrentCellOptions |
AllowGridToFocus
Declaration
public bool AllowGridToFocus { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
CellModel
Returns the cell model.
Declaration
public GridCellModelBase CellModel { get; }
Property Value
| Type |
|---|
| GridCellModelBase |
CellRowColumnIndex
Returns the cell row column index.
Declaration
public RowColumnIndex CellRowColumnIndex { get; }
Property Value
| Type |
|---|
| RowColumnIndex |
ColumnIndex
Returns the column index of the cell.
Declaration
public int ColumnIndex { get; }
Property Value
| Type |
|---|
| System.Int32 |
ControlText
The active text that is displayed for the current cell, e.g. TextBox.Text.
Declaration
public virtual string ControlText { get; set; }
Property Value
| Type |
|---|
| System.String |
ControlValue
Gets or sets the cell value for the current cell.
Declaration
public virtual object ControlValue { get; set; }
Property Value
| Type |
|---|
| System.Object |
CurrentCell
Returns the current cell.
Declaration
public GridCurrentCell CurrentCell { get; }
Property Value
| Type |
|---|
| GridCurrentCell |
CurrentCellUIElement
Returns the UI element of the current cell.
Declaration
public UIElement CurrentCellUIElement { get; protected set; }
Property Value
| Type |
|---|
| System.Windows.UIElement |
CurrentStyle
Returns the current cell style.
Declaration
public GridRenderStyleInfo CurrentStyle { get; }
Property Value
| Type |
|---|
| GridRenderStyleInfo |
CurrentStyleCopy
Returns a copy of the current cell style.
Declaration
public GridRenderStyleInfo CurrentStyleCopy { get; }
Property Value
| Type |
|---|
| GridRenderStyleInfo |
EditorType
Returns the type of the cell editor (cell control).
Declaration
public Type EditorType { get; set; }
Property Value
| Type |
|---|
| System.Type |
GridControl
Returns the parent grid.
Declaration
public GridControlBase GridControl { get; set; }
Property Value
| Type |
|---|
| GridControlBase |
HasControlText
Checks if ControlText for the current cell has been set.
Declaration
public bool HasControlText { get; }
Property Value
| Type |
|---|
| System.Boolean |
HasControlValue
Returns whether the cell value for the current cell has been changed.
Declaration
public bool HasControlValue { get; }
Property Value
| Type |
|---|
| System.Boolean |
HasCurrentCellState
Specifies whether the cell state for the current cell has been set.
Declaration
public bool HasCurrentCellState { get; }
Property Value
| Type |
|---|
| System.Boolean |
InInitialize
Declaration
protected bool InInitialize { get; }
Property Value
| Type |
|---|
| System.Boolean |
InSetControlText
Gets a value indicating whether ControlText setter is in process.
Declaration
public bool InSetControlText { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
|
InSetControlValue
Returns true if ControlValue setter was called.
Declaration
public bool InSetControlValue { get; }
Property Value
| Type |
|---|
| System.Boolean |
IsControlTextShown
Gets or sets a value that indicates whether the control text is displayed.
Declaration
public bool IsControlTextShown { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
IsDropDownable
Gets or sets a value that indicates whether the cell can be dropped down.
Declaration
public bool IsDropDownable { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
IsDroppedDown
Specifies whether the current cell is dropped down.
Declaration
public bool IsDroppedDown { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
IsEditable
Gets or sets a valude that indicates whether the cell is editable.
Declaration
public bool IsEditable { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
IsFocusable
Gets or sets a value that indicates whether the cell is focusable.
Declaration
public bool IsFocusable { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
IsFocused
Gets or sets a value that indicates whether the cell has the focus.
Declaration
public bool IsFocused { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
IsModifiable
Gets or sets a value that indicates whether the cell is modifiable.
Declaration
public bool IsModifiable { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
IsModified
Specifies wheter the cell has been modified.
Declaration
public bool IsModified { get; }
Property Value
| Type |
|---|
| System.Boolean |
RowIndex
Returns the row index of the cell.
Declaration
public int RowIndex { get; }
Property Value
| Type |
|---|
| System.Int32 |
SupportsRenderOptimization
Gets or sets whether the renderer supports rendering itsself 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. The default value is false.
Declaration
public bool SupportsRenderOptimization { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
Methods
ApplyControlText(GridRenderStyleInfo, String)
Declaration
protected virtual bool ApplyControlText(GridRenderStyleInfo style, string controlText)
Parameters
| Type | Name | Description |
|---|---|---|
| GridRenderStyleInfo | style | |
| System.String | controlText |
Returns
| Type |
|---|
| System.Boolean |
Dispose(Boolean)
Declaration
protected override void Dispose(bool isDisposing)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | isDisposing |
Overrides
EmptyRecycleBin()
Empties the recyclebin.
Declaration
public virtual void EmptyRecycleBin()
GetControlText(GridRenderStyleInfo)
Retrieves the ControlText of the current cell.
Declaration
public string GetControlText(GridRenderStyleInfo style)
Parameters
| Type | Name | Description |
|---|---|---|
| GridRenderStyleInfo | style | The cell style. |
Returns
| Type | Description |
|---|---|
| System.String | The control text. |
GetControlTextCore(GridRenderStyleInfo, Object)
Declaration
protected virtual string GetControlTextCore(GridRenderStyleInfo style, object cellValue)
Parameters
| Type | Name | Description |
|---|---|---|
| GridRenderStyleInfo | style | |
| System.Object | cellValue |
Returns
| Type |
|---|
| System.String |
GetControlTextFromEditor()
Retrieves the ControlText from the cell editor.
Declaration
public virtual string GetControlTextFromEditor()
Returns
| Type | Description |
|---|---|
| System.String | ControlText. |
GetControlValue(GridRenderStyleInfo)
Gets the cell value from the given cell style.
Declaration
public object GetControlValue(GridRenderStyleInfo style)
Parameters
| Type | Name | Description |
|---|---|---|
| GridRenderStyleInfo | style | The cell style. |
Returns
| Type | Description |
|---|---|
| System.Object | The cell value. |
GetControlValueFromEditor()
Declaration
protected virtual object GetControlValueFromEditor()
Returns
| Type |
|---|
| System.Object |
IsCurrentCell(GridControlBase, RowColumnIndex)
Determines whether the given cell coordinates represent the current cell.
Declaration
public bool IsCurrentCell(GridControlBase gridControl, RowColumnIndex cellRowColumnIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| GridControlBase | gridControl | The grid. |
| RowColumnIndex | cellRowColumnIndex | The cell row column index. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if it is current cell; false otherwise. |
IsCurrentCell(GridRenderStyleInfo)
Determines whether the given cell style represents the current cell.
Declaration
public bool IsCurrentCell(GridRenderStyleInfo style)
Parameters
| Type | Name | Description |
|---|---|---|
| GridRenderStyleInfo | style | Cell style information. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if it is current cell; false otherwise. |
IsCurrentCell(UIElement)
Determines whether the given cell element corresponds to the current cell.
Declaration
public bool IsCurrentCell(UIElement uiElement)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.UIElement | uiElement | The cell control. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if it is current cell; false otherwise. |
MouseDown(FrameworkElement, MouseControllerEventArgs)
Occurs when the mouse is down in a cell.
Declaration
public virtual void MouseDown(FrameworkElement owner, MouseControllerEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.FrameworkElement | owner | The owner element. |
| MouseControllerEventArgs | e | The MouseControllerEventArgs object. |
MoveCurrentHelper(FrameworkElement, MouseControllerEventArgs)
Declaration
protected static void MoveCurrentHelper(FrameworkElement owner, MouseControllerEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.FrameworkElement | owner | |
| MouseControllerEventArgs | e |
NotifyCurrentCellChanged()
Declaration
protected virtual void NotifyCurrentCellChanged()
NotifyCurrentCellChanging()
Declaration
protected virtual bool NotifyCurrentCellChanging()
Returns
| Type |
|---|
| System.Boolean |
OnActivated()
Declaration
protected virtual void OnActivated()
OnActivateFailed()
Declaration
protected virtual void OnActivateFailed()
OnActivating()
Declaration
protected virtual bool OnActivating()
Returns
| Type |
|---|
| System.Boolean |
OnClipboardPaste(GridCutPasteEventArgs)
Declaration
protected virtual void OnClipboardPaste(GridCutPasteEventArgs args)
Parameters
| Type | Name | Description |
|---|---|---|
| GridCutPasteEventArgs | args |
OnClipboardPasted(GridCutPasteEventArgs)
Declaration
protected virtual void OnClipboardPasted(GridCutPasteEventArgs args)
Parameters
| Type | Name | Description |
|---|---|---|
| GridCutPasteEventArgs | args |
OnConfirmChangesFailed()
Declaration
protected virtual void OnConfirmChangesFailed()
OnCreateAutomationPeer()
Declaration
public virtual AutomationPeer OnCreateAutomationPeer()
Returns
| Type |
|---|
| System.Windows.Automation.Peers.AutomationPeer |
OnCreated()
Declaration
protected virtual void OnCreated()
OnDeactivated()
Declaration
protected virtual void OnDeactivated()
OnDeactivateFailed()
Declaration
protected virtual void OnDeactivateFailed()
OnDeactivating()
Declaration
protected virtual bool OnDeactivating()
Returns
| Type |
|---|
| System.Boolean |
OnEditingComplete()
Declaration
protected virtual void OnEditingComplete()
OnEnteredEditMode()
Declaration
protected virtual void OnEnteredEditMode()
OnGridPreviewTextInput(TextCompositionEventArgs)
Declaration
protected virtual void OnGridPreviewTextInput(TextCompositionEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Input.TextCompositionEventArgs | e |
OnInitialize()
Declaration
protected virtual void OnInitialize()
OnRejectChanges()
Declaration
protected virtual void OnRejectChanges()
OnRenderForPrinting(DrawingContext, RenderCellArgs, GridRenderStyleInfo)
Called from RenderForPrinting(DrawingContext, RenderCellArgs, GridRenderStyleInfo) to manually force to render graphics while printing that do not belong to live controls and the cells which is not view (e.g. static text).
Declaration
protected virtual void OnRenderForPrinting(DrawingContext dc, RenderCellArgs rca, GridRenderStyleInfo cellInfo)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Media.DrawingContext | dc | The drawing context. |
| RenderCellArgs | rca | The render cell layout information. |
| GridRenderStyleInfo | cellInfo | The cell style info. |
OnResetFocus()
Declaration
protected virtual void OnResetFocus()
OnSaveChanges()
Declaration
protected virtual bool OnSaveChanges()
Returns
| Type |
|---|
| System.Boolean |
OnSetFocus()
Declaration
protected virtual void OnSetFocus()
OnValidate()
Declaration
protected virtual bool OnValidate()
Returns
| Type |
|---|
| System.Boolean |
OnValidated()
Declaration
protected virtual void OnValidated()
RaiseActivated()
Calls OnActivated().
Declaration
public void RaiseActivated()
RaiseActivateFailed()
Calls OnActivateFailed().
Declaration
public void RaiseActivateFailed()
RaiseActivating(GridControlBase, RowColumnIndex, GridActivateCurrentCellOptions)
Calls OnActivating().
Declaration
public bool RaiseActivating(GridControlBase gridControl, RowColumnIndex cellRowColumnIndex, GridActivateCurrentCellOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| GridControlBase | gridControl | The grid. |
| RowColumnIndex | cellRowColumnIndex | The cell row column index. |
| GridActivateCurrentCellOptions | options | The options to activate the current cell. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True. |
RaiseBeginEdit()
Begins the editing mode for the cell.
Declaration
public void RaiseBeginEdit()
RaiseClipboardPaste(GridCutPasteEventArgs)
call OnClipboardPaste(GridCutPasteEventArgs args)
Declaration
public void RaiseClipboardPaste(GridCutPasteEventArgs args)
Parameters
| Type | Name | Description |
|---|---|---|
| GridCutPasteEventArgs | args |
RaiseClipboardPasted(GridCutPasteEventArgs)
call OnClipboardPasted(GridCutPasteEventArgs args)
Declaration
public void RaiseClipboardPasted(GridCutPasteEventArgs args)
Parameters
| Type | Name | Description |
|---|---|---|
| GridCutPasteEventArgs | args |
RaiseCreated(GridCellModelBase)
Occurs when the current cell model is created.
Declaration
public void RaiseCreated(GridCellModelBase cellModel)
Parameters
| Type | Name | Description |
|---|---|---|
| GridCellModelBase | cellModel | The cell model. |
RaiseDeactivated()
Calls OnDeactivated() and resets the current cell.
Declaration
public void RaiseDeactivated()
RaiseDeactivateFailed()
Calls OnDeactivateFailed().
Declaration
public void RaiseDeactivateFailed()
RaiseDeactivating()
Calls OnDeactivating().
Declaration
public bool RaiseDeactivating()
Returns
| Type | Description |
|---|---|
| System.Boolean | True. |
RaiseEditingComplete()
Calls OnEditingComplete().
Declaration
public void RaiseEditingComplete()
RaiseEndEdit()
Ends the editing mode for the cell.
Declaration
public void RaiseEndEdit()
RaiseGridCellClick(Int32, Int32, MouseControllerEventArgs)
Raises the GridCellClick event.
Declaration
public virtual void RaiseGridCellClick(int rowIndex, int colIndex, MouseControllerEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | rowIndex | The cell row index. |
| System.Int32 | colIndex | The cell column index. |
| MouseControllerEventArgs | e | A reference to MouseControllerEventArgs. |
RaiseGridPreviewMouseMove(RowColumnIndex, MouseEventArgs)
Triggers PreviewMouseMove event for the given cell coordinates.
Declaration
public virtual void RaiseGridPreviewMouseMove(RowColumnIndex rci, MouseEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| RowColumnIndex | rci | The row column index. |
| System.Windows.Input.MouseEventArgs | e | A System.Windows.Input.MouseEventArgs object. |
RaiseInitialize(GridActivateCurrentCellOptions)
Calls OnInitialize().
Declaration
public void RaiseInitialize(GridActivateCurrentCellOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| GridActivateCurrentCellOptions | options | The options to activate the current cell. |
RaiseRejectChanges()
Calls OnRejectChanges().
Declaration
public void RaiseRejectChanges()
RaiseSaveChanges()
Calls OnSaveChanges().
Declaration
public bool RaiseSaveChanges()
Returns
| Type | Description |
|---|---|
| System.Boolean | True if the changes has been saved successfully. |
RaiseStartEditing()
Starts editing.
Declaration
public virtual bool RaiseStartEditing()
Returns
| Type | Description |
|---|---|
| System.Boolean | True. |
RaiseValidate()
Calls OnValidate().
Declaration
public bool RaiseValidate()
Returns
| Type | Description |
|---|---|
| System.Boolean | True. |
RaiseValidated()
Calls OnValidated().
Declaration
public void RaiseValidated()
RefreshContent()
Refreshes the current cell.
Declaration
public virtual void RefreshContent()
ResetControlText()
Resets the ControlText to its original state.
Declaration
public void ResetControlText()
ResetControlValue()
Resets the cell value of the current cell to its original state.
Declaration
public void ResetControlValue()
ResetCurrentCellState()
Declaration
protected void ResetCurrentCellState()
ScrollInView()
Declaration
protected virtual void ScrollInView()
SetControlText(String)
Sets the given value as control text for the cell.
Declaration
public bool SetControlText(string value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | value | The value. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if the control text has been set successfully; false otherwise. |
SetControlText(String, Boolean)
Sets the given value as control text for the cell.
Declaration
public bool SetControlText(string value, bool enforceApplyControlText)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | value | The value. |
| System.Boolean | enforceApplyControlText | When true, enforces applying control text. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if the control text has been set successfully; false otherwise. |
SetControlValue(Object)
Sets the cell value.
Declaration
public bool SetControlValue(object value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | value | the value to be set. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if the value has been set sucessfully; false otherwise. |
SetCurrentCellState(GridControlBase, RowColumnIndex, GridActivateCurrentCellOptions)
Declaration
protected void SetCurrentCellState(GridControlBase gridControl, RowColumnIndex cellRowColumnIndex, GridActivateCurrentCellOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| GridControlBase | gridControl | |
| RowColumnIndex | cellRowColumnIndex | |
| GridActivateCurrentCellOptions | options |
ShouldCurrentCellShowCellText()
Specifies whether the current cell should show the cell text that is being entered.
Declaration
public virtual bool ShouldCurrentCellShowCellText()
Returns
| Type | Description |
|---|---|
| System.Boolean | True if the text is shown; false otherwise. |
ShouldGridTryToHandlePreviewKeyDown(KeyEventArgs)
Declaration
protected virtual bool ShouldGridTryToHandlePreviewKeyDown(KeyEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Input.KeyEventArgs | e |
Returns
| Type |
|---|
| System.Boolean |
StyleChanged(StyleChangedEventArgs)
Occurs when the current cell style is changed.
Declaration
public void StyleChanged(StyleChangedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| StyleChangedEventArgs | e | The StyleChangedEventArgs object. |
UpdateCellRowColumnIndex(RowColumnIndex)
Updates the cell row column index with the given value.
Declaration
public void UpdateCellRowColumnIndex(RowColumnIndex cellRowColumnIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| RowColumnIndex | cellRowColumnIndex | The cell row column index. |
UpdateCurrentStyle()
Declaration
public void UpdateCurrentStyle()
ValidateControlText(String)
Validates the control text.
Declaration
public virtual bool ValidateControlText(string value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | value | Value to be validated. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True. |
ValidateControlValue(Object)
Validates the cell value.
Declaration
public virtual bool ValidateControlValue(object value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | value | The value to be validated. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True. |
Explicit Interface Implementations
IGridCellRenderer.RaiseConfirmChangesFailed()
Declaration
void IGridCellRenderer.RaiseConfirmChangesFailed()
IGridCellRenderer.RaiseGridPreviewTextInput(TextCompositionEventArgs)
Declaration
void IGridCellRenderer.RaiseGridPreviewTextInput(TextCompositionEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Input.TextCompositionEventArgs | e |
IGridCellRenderer.RenderForPrinting(DrawingContext, RenderCellArgs, GridRenderStyleInfo)
Declaration
void IGridCellRenderer.RenderForPrinting(DrawingContext dc, RenderCellArgs rca, GridRenderStyleInfo cellInfo)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Media.DrawingContext | dc | |
| RenderCellArgs | rca | |
| GridRenderStyleInfo | cellInfo |
IGridCellRenderer.ShouldGridTryToHandlePreviewKeyDown(KeyEventArgs)
Declaration
bool IGridCellRenderer.ShouldGridTryToHandlePreviewKeyDown(KeyEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Input.KeyEventArgs | e |
Returns
| Type |
|---|
| System.Boolean |