DrawingOverlayBase<TDrawing> Class

Shared rendering and geometry logic for floating drawings (charts, images) on a worksheet. Provides the outer container, frozen-pane splitting, selection chrome, and 8-direction resize handles; subclasses contribute only the inner content (e.g. SVG chart, img element).

Inheritance

Object

ComponentBase

Spreadsheet.DrawingOverlayBase<Spreadsheet.TDrawing>

Implements

IComponent

IHandleEvent

IHandleAfterRender

Inherited Members

ComponentBase.OnInitialized

ComponentBase.OnInitializedAsync

ComponentBase.OnParametersSet

ComponentBase.OnParametersSetAsync

ComponentBase.StateHasChanged

ComponentBase.ShouldRender

ComponentBase.OnAfterRender

ComponentBase.OnAfterRenderAsync

ComponentBase.InvokeAsync

ComponentBase.DispatchExceptionAsync

ComponentBase.SetParametersAsync

ComponentBase.RendererInfo

ComponentBase.Assets

ComponentBase.AssignedRenderMode

Namespace: Radzen.Blazor.Spreadsheet

Assembly: Radzen.Blazor.dll

Syntax

public abstract class DrawingOverlayBase<TDrawing> : ComponentBase, IComponent, IHandleEvent, IHandleAfterRender

Type Parameters

Name Description
TDrawingThe drawing model type (e.g. TYPEREF:Radzen.Documents.Spreadsheet.SheetChartSheetChart/TYPEREF or TYPEREF:Radzen.Documents.Spreadsheet.SheetImageSheetImage/TYPEREF).

Constructors

DrawingOverlayBase<TDrawing>link

Shared rendering and geometry logic for floating drawings (charts, images) on a worksheet. Provides the outer container, frozen-pane splitting, selection chrome, and 8-direction resize handles; subclasses contribute only the inner content (e.g. SVG chart, img element).

Declaration
protected DrawingOverlayBase<TDrawing>()

Properties

BaseCssClasslink

The base CSS class for this drawing kind, e.g. rz-spreadsheet-chart.

Declaration
protected string BaseCssClass { get; }
Property Value
Type Description
stringThe base CSS class for this drawing kind, e.g. rz-spreadsheet-chart.

Contextlink

Gets or sets the virtual grid context used to translate cell ranges to pixel rectangles.

Declaration
public Spreadsheet.IVirtualGridContext Context { get; set; }
Property Value
Type Description
Spreadsheet.IVirtualGridContextGets or sets the virtual grid context used to translate cell ranges to pixel rectangles.

Drawingslink

The drawings to render.

Declaration
protected IEnumerable<Spreadsheet.TDrawing> Drawings { get; }
Property Value
Type Description
IEnumerable<Spreadsheet.TDrawing>The drawings to render.

HasContextMenulink

Whether the outer element should attach a context-menu handler. Off by default; override to true when MouseEventArgs,`0) is implemented.

Declaration
protected bool HasContextMenu { get; }
Property Value
Type Description
boolWhether the outer element should attach a context-menu handler. Off by default; override to true when MouseEventArgs,`0) is implemented.

Worksheetlink

Gets or sets the worksheet whose drawings are rendered.

Declaration
public Documents.Spreadsheet.Worksheet Worksheet { get; set; }
Property Value
Type Description
Documents.Spreadsheet.WorksheetGets or sets the worksheet whose drawings are rendered.

Methods

BuildRenderTreelink

Declaration
protected override void BuildRenderTree(Rendering.RenderTreeBuilder builder)
Parameters
Type Name Description
Rendering.RenderTreeBuilder builder

Disposelink

Declaration
public virtual void Dispose()

GetDimensionslink

Computes the drawing's effective pixel dimensions (handles both anchor modes).

Declaration
protected ValueTuple<double, double> GetDimensions(Spreadsheet.TDrawing drawing, Documents.Spreadsheet.RangeRef range)
Parameters
Type Name Description
Spreadsheet.TDrawing drawing
Documents.Spreadsheet.RangeRef range
Returns
Type Description
ValueTuple<double, double>

GetDrawingRangelink

Computes the cell range covered by the drawing, including OneCellAnchor walk to find the end cell.

Declaration
protected Documents.Spreadsheet.RangeRef GetDrawingRange(Spreadsheet.TDrawing drawing)
Parameters
Type Name Description
Spreadsheet.TDrawing drawing
Returns

IsSelectedlink

Whether the supplied drawing is the currently selected one.

Declaration
protected abstract bool IsSelected(Spreadsheet.TDrawing drawing)
Parameters
Type Name Description
Spreadsheet.TDrawing drawing
Returns
Type Description
bool

OnDrawingContextMenulink

Optional context-menu handler. No-op by default.

Declaration
protected virtual void OnDrawingContextMenu(MouseEventArgs e, Spreadsheet.TDrawing drawing)
Parameters
Type Name Description
MouseEventArgs e
Spreadsheet.TDrawing drawing

OnDrawingGeometryChangedlink

Repaints this overlay when a drawing of its own kind changes geometry during a drag.

Declaration
protected void OnDrawingGeometryChanged(Documents.Spreadsheet.IAnchoredDrawing drawing)
Parameters
Type Name Description
Documents.Spreadsheet.IAnchoredDrawing drawing

OnDrawingPointerDownlink

Handles pointer-down on the drawing's outer element. Default selects the drawing and clears the cell selection.

Declaration
protected virtual void OnDrawingPointerDown(PointerEventArgs e, Spreadsheet.TDrawing drawing)
Parameters
Type Name Description
PointerEventArgs e
Spreadsheet.TDrawing drawing

RenderInnerlink

Renders the drawing-specific inner content into the container.

Declaration
protected abstract void RenderInner(Rendering.RenderTreeBuilder builder, Spreadsheet.TDrawing drawing, Documents.Spreadsheet.RangeRef range)
Parameters
Type Name Description
Rendering.RenderTreeBuilder builder
Spreadsheet.TDrawing drawing
Documents.Spreadsheet.RangeRef range

SelectDrawinglink

Sets the worksheet's selected drawing to this one.

Declaration
protected abstract void SelectDrawing(Spreadsheet.TDrawing drawing)
Parameters
Type Name Description
Spreadsheet.TDrawing drawing
An error has occurred. This app may no longer respond until reloaded. Reload 🗙