Interface ICellRenderer
Defines the interface for a cell renderer in a VirtualizingCellsControl. A default implementation of this interface is provided by the CellRendererBase<S> class from which you should derive custom cell renderer classes. There is however no dependency on CellRendererBase inside the VirtualizingCellsControl, the VirtualizingCellsControl base class only depends on this interface.
Namespace: Syncfusion.Windows.Controls.Cells
Assembly: Syncfusion.GridCommon.WPF.dll
Syntax
public interface ICellRenderer
Properties
UnloadUIElementsWhenScrolledOutOfView
Called from ArrangeCellUIElements(Size) to determine whether the parent control should unload visuals when the cell is scrolled out of the viewable area.
Declaration
bool UnloadUIElementsWhenScrolledOutOfView { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Methods
Arrange(ArrangeCellArgs)
Called OnArrangeCell(ArrangeCellArgs) to arrange the cells UIElement children. CellRendererBase<S> implements this method and calls the virtual OnArrange(ArrangeCellArgs, S) method.
Declaration
void Arrange(ArrangeCellArgs aca)
Parameters
Type | Name | Description |
---|---|---|
ArrangeCellArgs | aca | The arange cell layout information. |
CancelMouseCapture(UIElement)
This method is called from Syncfusion.Windows.Controls.Cells.CellMouseCaptureInfo 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)
CellRendererBase<S> implements this method and calls the virtual OnCancelMouseCapture(UIElement) method.
Declaration
void CancelMouseCapture(UIElement element)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.UIElement | element | The UIElement child |
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
void Hide(UIElement e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.UIElement | e | The e. |
PrepareUIElements(ArrangeCellArgs, List<UIElement>, ScrollControlChildFrame)
Called from PrepareCellUIElements(ArrangeCellArgs, List<UIElement>, ScrollControlChildFrame) to prepare the cells UIElement children. CellRendererBase<S> implements this method and calls the virtual OnPrepareUIElements(ArrangeCellArgs, List<UIElement>, ScrollControlChildFrame, S) method. VirtualizingCellRendererBase<T> overrides this method and creates new UIElements and wires them with the parent cells control.
Declaration
void PrepareUIElements(ArrangeCellArgs aca, List<UIElement> uiElements, ScrollControlChildFrame canvas)
Parameters
Type | Name | Description |
---|---|---|
ArrangeCellArgs | aca | The arrange 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. |
RecaptureMouse(UIElement)
This method is called from Syncfusion.Windows.Controls.Cells.CellMouseCaptureInfo to restore mouse capture when context of mouse operation changes back to original context.
CellRendererBase<S> implements this method and calls the virtual OnRecaptureMouse(UIElement) method.
Declaration
void RecaptureMouse(UIElement element)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.UIElement | element | The UIElement child |
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).
call.
Declaration
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. |
Render(DrawingContext, RenderCellArgs)
Called from OnRenderCell(DrawingContext, RenderCellArgs) to manually render graphics that do not belong to live controls (e.g. static text). CellRendererBase<S> implements this method and calls the virtual OnRender(DrawingContext, RenderCellArgs, S) method.
Declaration
void Render(DrawingContext dc, RenderCellArgs rca)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Media.DrawingContext | dc | The drawing context. |
RenderCellArgs | rca | The render cell layout information. |
UnloadUIElements(VirtualizingCellsControl, RowColumnIndex, CellUIElements)
This method is called after a cell is scrolled out of view. CellRendererBase<S> implements this method and calls the virtual OnUnloadUIElements(VirtualizingCellsControl, RowColumnIndex, CellUIElements) method. 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
void UnloadUIElements(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. |