Class CellRendererBase<S>
The CellRendererBase<S> class provides a default implementation of the ICellRenderer interface for a cell renderer in a VirtualizingCellsControl.
You should derive from this class to implement custom cell renderer classes. There is however no dependency on CellRendererBase inside the VirtualizingCellsControl, the VirtualizingCellsControl base class only depends on this interface.
If you want to implement a renderer with support for live UIElement visuals inside the cell you should derive from the VirtualizingCellRendererBase<T> or grid/treeview adapted VirtualizingCellRendererBase classes.
Inheritance
Inherited Members
Namespace: Syncfusion.Windows.Controls.Cells
Assembly: Syncfusion.GridCommon.WPF.dll
Syntax
public class CellRendererBase<S> : Disposable, IDisposable, ICellRenderer where S : IRenderCellInfo
Type Parameters
Name | Description |
---|---|
S | The type for render cell styles. The type must implement IRenderCellInfo |
Constructors
CellRendererBase()
Declaration
public CellRendererBase()
Fields
isInArrange
Declaration
protected bool isInArrange
Field Value
Type |
---|
System.Boolean |
Properties
AllowCancelMouseCapture
Gets or sets a value indicating whether the control supports canceling mouse capture.
Declaration
public bool AllowCancelMouseCapture { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
IsInArrange
Gets a value indicating whether this instance is processing OnArrange(ArrangeCellArgs, S).
Declaration
public bool IsInArrange { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
UnloadVisualsWhenScrolledOutOfView
Called from ArrangeCellUIElements(Size) to determine whether the parent control should unload visuals when the cell is scrolled out of the viewable area.
Declaration
public bool UnloadVisualsWhenScrolledOutOfView { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Methods
Hide(UIElement)
Hides the specified UIElement. You should implement this method in your renderer and call e.Arrange(new Rect(0, 0, 0, 0)); If this however causes problems then you can instead call e.Visibility = Visibility.Hidden;. Using Arrange has one benefit for example that capture state of a textbox does not get affected.
Declaration
public virtual void Hide(UIElement e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.UIElement | e | The e. |
OnArrange(ArrangeCellArgs, S)
Called from Arrange(ArrangeCellArgs) to arrange the cells UIElement children.
Declaration
protected virtual void OnArrange(ArrangeCellArgs aca, S cellInfo)
Parameters
Type | Name | Description |
---|---|---|
ArrangeCellArgs | aca | The arange cell layout information. |
S | cellInfo | The cell style info. |
OnCancelMouseCapture(UIElement)
Called from CancelMouseCapture(UIElement) to take away mouse capture when context of mouse operation changes (e.g. from selecting text inside one cell to selecting multiple cells in a grid)
Declaration
protected virtual void OnCancelMouseCapture(UIElement element)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.UIElement | element | The UIElement child |
OnPrepareUIElements(ArrangeCellArgs, List<UIElement>, ScrollControlChildFrame, S)
Called from Arrange(ArrangeCellArgs) to prepare the cells UIElement children. VirtualizingCellRendererBase<T> overrides this method and creates new UIElements and wires them with the parent cells control.
Declaration
protected virtual void OnPrepareUIElements(ArrangeCellArgs aca, List<UIElement> uiElements, ScrollControlChildFrame canvas, S cellInfo)
Parameters
Type | Name | Description |
---|---|---|
ArrangeCellArgs | aca | The arange cell layout information. |
System.Collections.Generic.List<System.Windows.UIElement> | uiElements | The UI elements. |
ScrollControlChildFrame | canvas | The canvas to which any UIElement elements should be added. |
S | cellInfo | The cell style info. |
OnRecaptureMouse(UIElement)
Called from from RecaptureMouse(UIElement) to restore mouse capture when context of mouse operation changes back to original context
Declaration
protected virtual void OnRecaptureMouse(UIElement element)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.UIElement | element | The UIElement child |
OnRender(DrawingContext, RenderCellArgs, S)
Called from Render(DrawingContext, RenderCellArgs) to manually render graphics that do not belong to live controls (e.g. static text).
Declaration
protected virtual void OnRender(DrawingContext dc, RenderCellArgs rca, S cellInfo)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Media.DrawingContext | dc | The drawing context. |
RenderCellArgs | rca | The render cell layout information. |
S | cellInfo | The cell style info. |
OnUnloadUIElements(VirtualizingCellsControl, RowColumnIndex, CellUIElements)
Called from UnloadUIElements(VirtualizingCellsControl, RowColumnIndex, CellUIElements) after a cell is scrolled out of view. VirtualizingCellRendererBase<T> overrides this method and creates 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
protected virtual void OnUnloadUIElements(VirtualizingCellsControl host, RowColumnIndex cellRowColumnIndex, CellUIElements visuals)
Parameters
Type | Name | Description |
---|---|---|
VirtualizingCellsControl | host | The host. |
RowColumnIndex | cellRowColumnIndex | Index of the cell row column. |
CellUIElements | visuals | The visuals. |
RefreshCellUIElementsContent(VirtualizingCellsControl, CellUIElements, RowColumnIndex)
Determine if cell at given cells row and column index is associated with UIElement. If yes,
reintialize the cells UIElement. You should implement this method in the cell renderer
and redirect the call to RefreshCellUIElementsContent(RowColumnIndex)
on the supplied cellsControl
. If you have a complex renderer
(e.g. a nested grid) for which there is no need to reinitalize contents you can
override this method and do nothing. This usually is called as a response to an
earlier InvalidateCell(RowColumnIndex).
Declaration
public virtual void RefreshCellUIElementsContent(VirtualizingCellsControl cellsControl, CellUIElements cellUIElements, RowColumnIndex rowColumnIndex)
Parameters
Type | Name | Description |
---|---|---|
VirtualizingCellsControl | cellsControl | The cells control. |
CellUIElements | cellUIElements | The cell visuals. |
RowColumnIndex | rowColumnIndex | Index of the row column. |
Explicit Interface Implementations
ICellRenderer.Arrange(ArrangeCellArgs)
Declaration
void ICellRenderer.Arrange(ArrangeCellArgs aca)
Parameters
Type | Name | Description |
---|---|---|
ArrangeCellArgs | aca |
ICellRenderer.CancelMouseCapture(UIElement)
Declaration
void ICellRenderer.CancelMouseCapture(UIElement element)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.UIElement | element |
ICellRenderer.PrepareUIElements(ArrangeCellArgs, List<UIElement>, ScrollControlChildFrame)
Declaration
void ICellRenderer.PrepareUIElements(ArrangeCellArgs aca, List<UIElement> uiElements, ScrollControlChildFrame canvas)
Parameters
Type | Name | Description |
---|---|---|
ArrangeCellArgs | aca | |
System.Collections.Generic.List<System.Windows.UIElement> | uiElements | |
ScrollControlChildFrame | canvas |
ICellRenderer.RecaptureMouse(UIElement)
Declaration
void ICellRenderer.RecaptureMouse(UIElement element)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.UIElement | element |
ICellRenderer.Render(DrawingContext, RenderCellArgs)
Declaration
void ICellRenderer.Render(DrawingContext dc, RenderCellArgs rca)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Media.DrawingContext | dc | |
RenderCellArgs | rca |
ICellRenderer.UnloadUIElements(VirtualizingCellsControl, RowColumnIndex, CellUIElements)
Declaration
void ICellRenderer.UnloadUIElements(VirtualizingCellsControl host, RowColumnIndex cellRowColumnIndex, CellUIElements visuals)
Parameters
Type | Name | Description |
---|---|---|
VirtualizingCellsControl | host | |
RowColumnIndex | cellRowColumnIndex | |
CellUIElements | visuals |
ICellRenderer.UnloadUIElementsWhenScrolledOutOfView
Declaration
bool ICellRenderer.UnloadUIElementsWhenScrolledOutOfView { get; }
Returns
Type |
---|
System.Boolean |