Class SpreadsheetVirtualizingCellRendererBase<D, E>
VirtualizingCellRendererBase is an abstract base class for cell renderers that need live UIElement visuals displayed in a cell. You can derive from this class and provide the type of the UIElement you want to show inside cells as type parameter. The class provides strong typed virtual methods for initializing content of the cell and arranging the cell visuals.
The class manages the creation of cells UIElement objects when the cell is scrolled into view and also unloading of the elements. The class offers an optimization in which elements can be recycled when AllowRecycle is set. In this case when a cell is scrolled out of view it is moved into a recycle bin and the next time a new element is scrolled into view the element is recovered from the recycle bin and reinitialized with the new content of the cell.
when the user moves the mouse over the cell or if the UIElement is needed for other reasons.
After a UIElement was created the virtual methods Syncfusion.UI.Xaml.Spreadsheet.CellRenderer.SpreadsheetVirtualizingCellRendererBase`2.WireEditUIElement(`1) and Syncfusion.UI.Xaml.Spreadsheet.CellRenderer.SpreadsheetVirtualizingCellRendererBase`2.UnwireEditUIElement(`1) are called to wire any event listeners.
Updates to appearance and content of child elements, creation and unloading of elements will not trigger ArrangeOverride or Render calls in parent canvas.
Inheritance
Inherited Members
Namespace: Syncfusion.UI.Xaml.Spreadsheet.CellRenderer
Assembly: Syncfusion.SfSpreadsheet.WPF.dll
Syntax
public abstract class SpreadsheetVirtualizingCellRendererBase<D, E> : SpreadsheetCellRendererBase, ISpreadsheetCellRenderer, IDisposable where D : FrameworkElement, new()
where E : FrameworkElement, new()
Type Parameters
Name | Description |
---|---|
D | The type of the UIElement that should be placed inside cells in display mode. |
E | The type of the UIElement that should be placed inside cells in edit mode. |
Constructors
SpreadsheetVirtualizingCellRendererBase()
Initializes a new instance of the SpreadsheetVirtualizingCellRendererBase<D, E> class.
Declaration
public SpreadsheetVirtualizingCellRendererBase()
Fields
DisplayRecycleBin
Creates a new instance of VirtualizingCellUIElementBin<T> class.
Declaration
protected VirtualizingCellUIElementBin<D> DisplayRecycleBin
Field Value
Type |
---|
VirtualizingCellUIElementBin<D> |
EditRecycleBin
Creates a new instance of VirtualizingCellUIElementBin<T> class.
Declaration
protected VirtualizingCellUIElementBin<E> EditRecycleBin
Field Value
Type |
---|
VirtualizingCellUIElementBin<E> |
TemplateRecycleBin
Creates a new instance of VirtualizingCellUIElementBin<T> class.
Declaration
protected VirtualizingCellUIElementBin<ContentControl> TemplateRecycleBin
Field Value
Type |
---|
VirtualizingCellUIElementBin<System.Windows.Controls.ContentControl> |
Properties
AllowRecycle
Gets or sets a value indicating whether elements can be recycled when scrolled out of view. In this case when a cell is scrolled out of view it is moved into a recycle bin and the next time a new element is scrolled into view the element is recovered from the recycle bin and reinitialized with the new content of the cell. The default value is false.
Declaration
public bool AllowRecycle { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Methods
BeginEdit(RowColumnIndex, GridCell, SpreadsheetColumn)
Invoked when the current cell in the view starts the editing process.
Declaration
public override sealed bool BeginEdit(RowColumnIndex cellRowColumnIndex, GridCell cellContainer, SpreadsheetColumn column)
Parameters
Type | Name | Description |
---|---|---|
RowColumnIndex | cellRowColumnIndex | Coordinates of a cell. |
GridCell | cellContainer | An instance of GridCell. |
SpreadsheetColumn | column | An instance of SpreadsheetColumn. |
Returns
Type | Description |
---|---|
System.Boolean | Returns true if the current cell starts an editing; otherwise, false. |
Overrides
ClearRecycleBin()
Clears all the items from RecycleBin.
Declaration
public override void ClearRecycleBin()
Overrides
Dispose(Boolean)
Releases all resources used by the Syncfusion.UI.Xaml.Spreadsheet.CellRenderer.SpreadsheetVirtualizingCellRendererBase.
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing | Dispose the instance, if it is True |
Overrides
Remarks
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
EndEdit(RowColumnIndex, GridCell, SpreadsheetColumn)
Ends the editing operation occuring in the cell.
Declaration
public override sealed bool EndEdit(RowColumnIndex cellRowColumnIndex, GridCell cellContainer, SpreadsheetColumn column)
Parameters
Type | Name | Description |
---|---|---|
RowColumnIndex | cellRowColumnIndex | Cooridantes of a cell. |
GridCell | cellContainer | An instance of GridCell. |
SpreadsheetColumn | column | An instance of SpreadsheetColumn. |
Returns
Type | Description |
---|---|
System.Boolean | Returns true if the edit ends on the cell ; otherwise, false. |
Overrides
InitializeDisplayElement(RowColumnIndex, D, SpreadsheetColumn)
Invoked when the display element is initialized on the cell.
Declaration
public void InitializeDisplayElement(RowColumnIndex rowColumnIndex, D uiElement, SpreadsheetColumn column)
Parameters
Type | Name | Description |
---|---|---|
RowColumnIndex | rowColumnIndex | Coordinates of cell. |
D | uiElement | The display UIElement. |
SpreadsheetColumn | column | An instance of SpreadsheetColumn. |
InitializeEditElement(RowColumnIndex, E, SpreadsheetColumn)
Invoked when the edit element is initialized on the cell.
Declaration
public void InitializeEditElement(RowColumnIndex rowColumnIndex, E uiElement, SpreadsheetColumn column)
Parameters
Type | Name | Description |
---|---|---|
RowColumnIndex | rowColumnIndex |
|
E | uiElement | The edit UIElement. |
SpreadsheetColumn | column | An instance of SpreadsheetColumn. |
OnArrange(RowColumnIndex, UIElement, Rect)
Invoked when the visual children of cell is arranged in view.
Declaration
protected override void OnArrange(RowColumnIndex cellRowColumnIndex, UIElement uiElement, Rect cellRect)
Parameters
Type | Name | Description |
---|---|---|
RowColumnIndex | cellRowColumnIndex | The Coordinates of the cell. |
System.Windows.UIElement | uiElement | The corresponding UIElement that is to be arranged. |
System.Windows.Rect | cellRect | The corresponding size of cell element for arranging the UIElement. |
Overrides
OnCreateDisplayUIElement()
Creates a new UIElement for the display mode of cell.
Declaration
protected virtual D OnCreateDisplayUIElement()
Returns
Type | Description |
---|---|
D | A UIElement for the display mode. |
OnCreateEditUIElement()
Creates a new UIElement for the edit mode of cell.
Declaration
protected virtual E OnCreateEditUIElement()
Returns
Type | Description |
---|---|
E | A UIElement for the edit mode. |
OnCreateTemplateUIElement()
Creates a new template UIElement for the cell.
Declaration
protected virtual ContentControl OnCreateTemplateUIElement()
Returns
Type | Description |
---|---|
System.Windows.Controls.ContentControl | An instance of System.Windows.Controls. |
OnEditElementLoaded(Object, RoutedEventArgs)
Occurs when the Edit UIElement loaded in SpreadsheetColumn.
Declaration
protected virtual void OnEditElementLoaded(object sender, RoutedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Object | sender | The source of the event. |
System.Windows.RoutedEventArgs | e | An System.Windows.RoutedEventArgs that contains the event data. |
OnEditElementLostFocus(Object, RoutedEventArgs)
Occurs when the Edit UIElement loses its logical focus.
Declaration
protected virtual void OnEditElementLostFocus(object sender, RoutedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Object | sender | The source of the event. |
System.Windows.RoutedEventArgs | e | An System.Windows.RoutedEventArgs that contains the event data. |
OnEditingComplete(UIElement)
Invoked when the editing operation is completed on the cell.
Declaration
protected virtual void OnEditingComplete(UIElement currentRendererElement)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.UIElement | currentRendererElement | An instance of System.Windows.UIElement. |
OnEnteredEditMode(UIElement)
Invoked when the cell is being entered into the edit mode.
Declaration
protected virtual void OnEnteredEditMode(UIElement currentRendererElement)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.UIElement | currentRendererElement | An instance of System.Windows.UIElement. |
OnInitializeDisplayElement(RowColumnIndex, D, SpreadsheetColumn)
Invoked when the display element is initialized on the cell.
Declaration
protected abstract void OnInitializeDisplayElement(RowColumnIndex rowColumnIndex, D uiElement, SpreadsheetColumn column)
Parameters
Type | Name | Description |
---|---|---|
RowColumnIndex | rowColumnIndex | Coordinates of cell. |
D | uiElement | The display UIElement. |
SpreadsheetColumn | column | An instance of SpreadsheetColumn. |
OnInitializeEditElement(RowColumnIndex, E, SpreadsheetColumn)
Invoked when the edit element is initialized on the cell
Declaration
protected abstract void OnInitializeEditElement(RowColumnIndex rowColumnIndex, E uiElement, SpreadsheetColumn column)
Parameters
Type | Name | Description |
---|---|---|
RowColumnIndex | rowColumnIndex |
|
E | uiElement | The edit UIElement |
SpreadsheetColumn | column | An instance of SpreadsheetColumn |
OnMeasure(RowColumnIndex, UIElement, Size)
Invoked to determine the size of the current cell.
Declaration
protected override void OnMeasure(RowColumnIndex cellRowColumnIndex, UIElement uiElement, Size availableSize)
Parameters
Type | Name | Description |
---|---|---|
RowColumnIndex | cellRowColumnIndex | Coordinates of a cell. |
System.Windows.UIElement | uiElement | The corresponding UIElement to measure. |
System.Windows.Size | availableSize | The size of element. |
Overrides
OnPrepareUIElements(RowColumnIndex, GridCell, SpreadsheetColumn, Boolean)
Invoked when the UIElement for cell is prepared to render it in view .
Declaration
protected override sealed GridCell OnPrepareUIElements(RowColumnIndex cellRowColumnIndex, GridCell cellContainer, SpreadsheetColumn column, bool isInEdit)
Parameters
Type | Name | Description |
---|---|---|
RowColumnIndex | cellRowColumnIndex | Coordinates of a cell. |
GridCell | cellContainer | An instance of GridCell. |
SpreadsheetColumn | column | An instance of SpreadsheetColumn. |
System.Boolean | isInEdit | Specifies whether the element is editable or not. |
Returns
Type | Description |
---|---|
GridCell | An instance of new GridCell. |
Overrides
OnUnloadUIElements(GridCell)
Invoked when the cell is scrolled out of view or unloaded from the view. SpreadsheetVirtualizingCellRendererBase<D, E> overrides this method and either removes the cell renderer visuals from the parent or hide them and reuse it later in same element depending on whether AllowRecycle was set.
Declaration
protected override void OnUnloadUIElements(GridCell uiElement)
Parameters
Type | Name | Description |
---|---|---|
GridCell | uiElement | An instance of GridCell. |
Overrides
OnUnwireDisplayUIElement(D)
Unwires the events associated with display UIElement.
Declaration
protected virtual void OnUnwireDisplayUIElement(D uiElement)
Parameters
Type | Name | Description |
---|---|---|
D | uiElement | The corresponding display UIElement to unwire its events. |
OnUnwireEditUIElement(E)
Unwires the events associated with edit UIElement.
Declaration
protected virtual void OnUnwireEditUIElement(E uiElement)
Parameters
Type | Name | Description |
---|---|---|
E | uiElement | The corresponding edit UIElement to unwire its events. |
OnUnWireTemplateUIElement(ContentControl)
Unwires the events associated with template UIElement.
Declaration
protected virtual void OnUnWireTemplateUIElement(ContentControl uiElement)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Controls.ContentControl | uiElement | The corresponding template UIElement to unwire its events. |
OnUpdateCellStyle(RowColumnIndex, D, SpreadsheetColumn)
Updates the style and content for display element.
Declaration
protected virtual void OnUpdateCellStyle(RowColumnIndex cellRowColumnIndex, D uiElement, SpreadsheetColumn column)
Parameters
Type | Name | Description |
---|---|---|
RowColumnIndex | cellRowColumnIndex | Coordinates of a cell. |
D | uiElement | UIelement of the Display mode. |
SpreadsheetColumn | column | An instance of SfSpreadsheet. |
OnUpdateEditCellStyle(RowColumnIndex, E, SpreadsheetColumn)
Updates the style and content for the edit element.
Declaration
protected virtual void OnUpdateEditCellStyle(RowColumnIndex cellRowColumnIndex, E uiElement, SpreadsheetColumn column)
Parameters
Type | Name | Description |
---|---|---|
RowColumnIndex | cellRowColumnIndex | Coordinates of a cell. |
E | uiElement | Corresponding UIElement to update the edit element. |
SpreadsheetColumn | column | An instance of SpreadsheetColumn. |
OnUpdateTemplateElement(ContentControl, IStyle)
Updates the Template UIElement with particular style info.
Declaration
protected virtual void OnUpdateTemplateElement(ContentControl uiElement, IStyle style)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Controls.ContentControl | uiElement | Corresponding UIElement to update the template element. |
IStyle | style | An instance of IStyle. |
OnWireDisplayUIElement(D)
Wires the events associated with display UIElement.
Declaration
protected virtual void OnWireDisplayUIElement(D uiElement)
Parameters
Type | Name | Description |
---|---|---|
D | uiElement | The corresponding display UIElement to wire its events. |
OnWireEditUIElement(E)
Wires the events associated with edit UIElement.
Declaration
protected virtual void OnWireEditUIElement(E uiElement)
Parameters
Type | Name | Description |
---|---|---|
E | uiElement | The corresponding edit UIElement to wire its events. |
OnWireTemplateUIElement(ContentControl)
Wires the events associated with template UIElement.
Declaration
protected virtual void OnWireTemplateUIElement(ContentControl uiElement)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Controls.ContentControl | uiElement | The corresponding template UIElement to wire its events. |
UpdateCellStyle(RowColumnIndex, GridCell, SpreadsheetColumn, Boolean)
Updates the style for the current cell in SfSpreadsheet.
Declaration
public override sealed void UpdateCellStyle(RowColumnIndex cellRowColumnIndex, GridCell uiElement, SpreadsheetColumn column, bool isInEdit)
Parameters
Type | Name | Description |
---|---|---|
RowColumnIndex | cellRowColumnIndex | Coordinates of cell. |
GridCell | uiElement | An instance of GridCell. |
SpreadsheetColumn | column | An instance of SpreadsheetColumn. |
System.Boolean | isInEdit | True or False |