A spreadsheet component that allows users to view and edit workbooks. It supports features like cell selection, editing, and keyboard shortcuts. The component can display a workbook with multiple sheets and allows users to navigate through cells using keyboard shortcuts. It also supports mouse interactions for selecting and editing cells, rows, and columns.
RadzenComponent.RaiseContextMenu
RadzenComponent.RaiseMouseEnter
RadzenComponent.AddContextMenu
RadzenComponent.RaiseMouseLeave
RadzenComponent.OnBecameInvisible
RadzenComponent.DefaultCulture
RadzenComponent.DefaultUICulture
RadzenComponent.IsJSRuntimeAvailable
ComponentBase.OnInitializedAsync
ComponentBase.OnParametersSet
ComponentBase.OnParametersSetAsync
ComponentBase.StateHasChanged
ComponentBase.ShouldRender
ComponentBase.OnAfterRender
ComponentBase.InvokeAsync
ComponentBase.DispatchExceptionAsync
ComponentBase.RendererInfo
ComponentBase.Assets
ComponentBase.AssignedRenderMode
Namespace: Radzen.Blazor
Assembly: Radzen.Blazor.dll
public class RadzenSpreadsheet : RadzenComponent, IComponent, IHandleEvent, IHandleAfterRender, ISpreadsheetA spreadsheet component that allows users to view and edit workbooks. It supports features like cell selection, editing, and keyboard shortcuts. The component can display a workbook with multiple sheets and allows users to navigate through cells using keyboard shortcuts. It also supports mouse interactions for selecting and editing cells, rows, and columns.
public RadzenSpreadsheet()Allows drag-to-fill (autofill) gestures.
public bool AllowAutofill { get; set; }
| Type | Description |
|---|---|
| bool | Allows drag-to-fill (autofill) gestures. |
Allows font, color, alignment, and border formatting commands.
public bool AllowCellFormatting { get; set; }
| Type | Description |
|---|---|
| bool | Allows font, color, alignment, and border formatting commands. |
Allows inserting, editing, moving, resizing, and deleting charts.
public bool AllowCharts { get; set; }
| Type | Description |
|---|---|
| bool | Allows inserting, editing, moving, resizing, and deleting charts. |
Allows cut, copy, and paste through the system clipboard. Independent of ReadOnly, so view-only users can still copy unless this is set to false. Cut and paste also require AllowEditing.
public bool AllowClipboard { get; set; }
| Type | Description |
|---|---|
| bool | Allows cut, copy, and paste through the system clipboard. Independent of ReadOnly, so view-only users can still copy unless this is set to false. Cut and paste also require AllowEditing. |
Allows adding and clearing conditional formatting rules.
public bool AllowConditionalFormatting { get; set; }
| Type | Description |
|---|---|
| bool | Allows adding and clearing conditional formatting rules. |
Allows adding and clearing data-validation rules.
public bool AllowDataValidation { get; set; }
| Type | Description |
|---|---|
| bool | Allows adding and clearing data-validation rules. |
Allows direct cell editing (type-to-edit, double-click, paste-into-cell, delete-key, autoaccept).
public bool AllowEditing { get; set; }
| Type | Description |
|---|---|
| bool | Allows direct cell editing (type-to-edit, double-click, paste-into-cell, delete-key, autoaccept). |
Allows filter and auto-filter commands and the filter UI affordances.
public bool AllowFiltering { get; set; }
| Type | Description |
|---|---|
| bool | Allows filter and auto-filter commands and the filter UI affordances. |
Allows inserting, editing, and following hyperlinks.
public bool AllowHyperlinks { get; set; }
| Type | Description |
|---|---|
| bool | Allows inserting, editing, and following hyperlinks. |
Allows inserting, moving, resizing, and deleting images.
public bool AllowImages { get; set; }
| Type | Description |
|---|---|
| bool | Allows inserting, moving, resizing, and deleting images. |
Allows cell merge and unmerge commands.
public bool AllowMerge { get; set; }
| Type | Description |
|---|---|
| bool | Allows cell merge and unmerge commands. |
Allows row and column resize gestures.
public bool AllowResizing { get; set; }
| Type | Description |
|---|---|
| bool | Allows row and column resize gestures. |
Allows single- and multi-key sort commands.
public bool AllowSorting { get; set; }
| Type | Description |
|---|---|
| bool | Allows single- and multi-key sort commands. |
Allows creating, editing, and removing structured tables.
public bool AllowTables { get; set; }
| Type | Description |
|---|---|
| bool | Allows creating, editing, and removing structured tables. |
Allows undo and redo of previously executed commands.
public bool AllowUndoRedo { get; set; }
| Type | Description |
|---|---|
| bool | Allows undo and redo of previously executed commands. |
Gets or sets the custom cell type definitions. Maps cell type names to their renderer and editor component types.
public Dictionary<string, Spreadsheet.SpreadsheetCellType> CellTypes { get; set; }
| Type | Description |
|---|---|
| Dictionary<string, Spreadsheet.SpreadsheetCellType> | Gets or sets the custom cell type definitions. Maps cell type names to their renderer and editor component types. |
Replaces the built-in toolsets. When set, the supplied content sits inside the toolbar's Tabs slot — each child should be a RadzenTabsItem. Add RadzenSpreadsheetTableDesignToolset to keep the contextual "Table Design" toolset.
public RenderFragment ChildContent { get; set; }
| Type | Description |
|---|---|
| RenderFragment | Replaces the built-in toolsets. When set, the supplied content sits inside the toolbar's Tabs slot — each child should be a RadzenTabsItem. Add RadzenSpreadsheetTableDesignToolset to keep the contextual "Table Design" toolset. |
Fires before a command is pushed onto the undo stack. Call PreventDefault from the handler to veto the command. Fires after ReadOnly, the matching Allow* flag, and the sheet's Protection have already approved the command.
public EventCallback<Spreadsheet.SpreadsheetCommandEventArgs> CommandExecuting { get; set; }
| Type | Description |
|---|---|
| EventCallback<Spreadsheet.SpreadsheetCommandEventArgs> | Fires before a command is pushed onto the undo stack. Call PreventDefault from the handler to veto the command. Fires after ReadOnly, the matching Allow* flag, and the sheet's Protection have already approved the command. |
Options applied when the user exports the workbook as CSV. When null, defaults are used (comma separator, UTF-8 with BOM, CRLF line endings, RFC 4180 minimal quoting, active sheet only).
public Documents.Spreadsheet.CsvExportOptions CsvExportOptions { get; set; }
| Type | Description |
|---|---|
| Documents.Spreadsheet.CsvExportOptions | Options applied when the user exports the workbook as CSV. When null, defaults are used (comma separator, UTF-8 with BOM, CRLF line endings, RFC 4180 minimal quoting, active sheet only). |
Options applied when the user opens a CSV file. When null, defaults are used (comma separator, UTF-8, value and formula auto-detection on).
public Documents.Spreadsheet.CsvImportOptions CsvImportOptions { get; set; }
| Type | Description |
|---|---|
| Documents.Spreadsheet.CsvImportOptions | Options applied when the user opens a CSV file. When null, defaults are used (comma separator, UTF-8, value and formula auto-detection on). |
The name of the file to export the workbook to when using the export functionality. When the user picks "Save as CSV" the extension is replaced with .csv.
public string ExportFileName { get; set; }
| Type | Description |
|---|---|
| string | The name of the file to export the workbook to when using the export functionality. When the user picks "Save as CSV" the extension is replaced with .csv. |
When true, the spreadsheet rejects every command that mutates the workbook. The user can still select cells, scroll, and copy. Defaults to false.
public bool ReadOnly { get; set; }
| Type | Description |
|---|---|
| bool | When true, the spreadsheet rejects every command that mutates the workbook. The user can still select cells, scroll, and copy. Defaults to false. |
The index of the active toolset in the toolbar. Defaults to 1 so the Home toolset is shown first. Supports two-way binding via @bind-SelectedToolsetIndex.
public int SelectedToolsetIndex { get; set; }
| Type | Description |
|---|---|
| int | The index of the active toolset in the toolbar. Defaults to 1 so the Home toolset is shown first. Supports two-way binding via @bind-SelectedToolsetIndex. |
Fired when the active toolset changes. Used by @bind-SelectedToolsetIndex.
public EventCallback<int> SelectedToolsetIndexChanged { get; set; }
| Type | Description |
|---|---|
| EventCallback<int> | Fired when the active toolset changes. Used by @bind-SelectedToolsetIndex. |
When true (the default) the formula bar is rendered between the toolbar and the grid.
public bool ShowFormulaBar { get; set; }
| Type | Description |
|---|---|
| bool | When true (the default) the formula bar is rendered between the toolbar and the grid. |
When true (the default) the sheet tab strip is rendered below the grid.
public bool ShowSheetTabs { get; set; }
| Type | Description |
|---|---|
| bool | When true (the default) the sheet tab strip is rendered below the grid. |
When true (the default) the toolbar is rendered above the grid. Set to false for kiosk or view-only embeds.
public bool ShowToolbar { get; set; }
| Type | Description |
|---|---|
| bool | When true (the default) the toolbar is rendered above the grid. Set to false for kiosk or view-only embeds. |
The workbook to display in the spreadsheet.
public Documents.Spreadsheet.Workbook Workbook { get; set; }
| Type | Description |
|---|---|
| Documents.Spreadsheet.Workbook | The workbook to display in the spreadsheet. |
Event callback that is invoked when the workbook changes.
public EventCallback<Documents.Spreadsheet.Workbook> WorkbookChanged { get; set; }
| Type | Description |
|---|---|
| EventCallback<Documents.Spreadsheet.Workbook> | Event callback that is invoked when the workbook changes. |
Accepts the current edit in the spreadsheet.
public Task<bool> AcceptAsync()
| Type | Description |
|---|---|
| Task<bool> |
protected override void BuildRenderTree(Rendering.RenderTreeBuilder __builder)
| Type | Name | Description |
|---|---|---|
| Rendering.RenderTreeBuilder | __builder |
public Task<bool> ExecuteAsync(Spreadsheet.ICommand command)
| Type | Name | Description |
|---|---|---|
| Spreadsheet.ICommand | command |
| Type | Description |
|---|---|
| Task<bool> |
protected override string GetComponentCssClass()
| Type | Description |
|---|---|
| string |
Returns true when the given feature is enabled. ReadOnly forces every feature off except Clipboard, which stays governed solely by AllowClipboard so view-only users can still copy data unless the host explicitly opts out.
public bool IsFeatureAllowed(Spreadsheet.SpreadsheetFeature feature)
| Type | Name | Description |
|---|---|---|
| Spreadsheet.SpreadsheetFeature | feature | The feature to check. |
| Type | Description |
|---|---|
| bool |
public Task LoadWorkbookAsync(Documents.Spreadsheet.Workbook workbook)
| Type | Name | Description |
|---|---|---|
| Documents.Spreadsheet.Workbook | workbook |
| Type | Description |
|---|---|
| Task |
protected override Task OnAfterRenderAsync(bool firstRender)
| Type | Name | Description |
|---|---|---|
| bool | firstRender |
| Type | Description |
|---|---|
| Task |
Invoked by JS interop when the autofill handle is pressed.
public void OnAutofillPointerDownAsync(PointerEventArgs args)
| Type | Name | Description |
|---|---|---|
| PointerEventArgs | args |
Invoked by JS interop when the pointer moves during an autofill drag.
public void OnAutofillPointerMoveAsync(PointerEventArgs args)
| Type | Name | Description |
|---|---|---|
| PointerEventArgs | args |
Invoked by JS interop when the pointer is released after an autofill drag.
public Task OnAutofillPointerUpAsync(PointerEventArgs args)
| Type | Name | Description |
|---|---|---|
| PointerEventArgs | args |
| Type | Description |
|---|---|
| Task |
Invoked by JS interop when a cell is right-clicked.
public Task OnCellContextMenuAsync(Spreadsheet.CellEventArgs args)
| Type | Name | Description |
|---|---|---|
| Spreadsheet.CellEventArgs | args |
| Type | Description |
|---|---|
| Task |
Invoked by JS interop when a cell is double-clicked with the pointer.
public Task OnCellDoubleClickAsync(Spreadsheet.CellEventArgs args)
| Type | Name | Description |
|---|---|---|
| Spreadsheet.CellEventArgs | args |
| Type | Description |
|---|---|
| Task |
Invoked by JS interop when a cell is clicked with the pointer.
public Task<bool> OnCellPointerDownAsync(Spreadsheet.CellEventArgs args)
| Type | Name | Description |
|---|---|---|
| Spreadsheet.CellEventArgs | args |
| Type | Description |
|---|---|
| Task<bool> |
Invoked by JS interop when the pointer moves over a cell.
public Task OnCellPointerMoveAsync(PointerEventArgs args)
| Type | Name | Description |
|---|---|---|
| PointerEventArgs | args |
| Type | Description |
|---|---|
| Task |
Invoked by JS interop when a column header is right-clicked.
public Task OnColumnContextMenuAsync(Spreadsheet.CellEventArgs args)
| Type | Name | Description |
|---|---|---|
| Spreadsheet.CellEventArgs | args |
| Type | Description |
|---|---|
| Task |
Invoked by JS interop when a column header is clicked with the pointer.
public Task<bool> OnColumnPointerDownAsync(Spreadsheet.CellEventArgs args)
| Type | Name | Description |
|---|---|---|
| Spreadsheet.CellEventArgs | args |
| Type | Description |
|---|---|
| Task<bool> |
Invoked by JS interop when the pointer moves over a column header.
public Task OnColumnPointerMoveAsync(PointerEventArgs args)
| Type | Name | Description |
|---|---|---|
| PointerEventArgs | args |
| Type | Description |
|---|---|
| Task |
Invoked by JS interop when the column resize handle is pressed.
public Task<bool> OnColumnResizePointerDownAsync(Spreadsheet.CellEventArgs args)
| Type | Name | Description |
|---|---|---|
| Spreadsheet.CellEventArgs | args |
| Type | Description |
|---|---|
| Task<bool> |
Invoked by JS interop when the pointer moves while resizing a column.
public Task OnColumnResizePointerMoveAsync(PointerEventArgs args)
| Type | Name | Description |
|---|---|---|
| PointerEventArgs | args |
| Type | Description |
|---|---|
| Task |
Invoked by JS interop when the pointer is released after resizing a column.
public Task OnColumnResizePointerUpAsync(PointerEventArgs args)
| Type | Name | Description |
|---|---|---|
| PointerEventArgs | args |
| Type | Description |
|---|---|
| Task |
Invoked by JS interop to copy the current selection to the clipboard.
public Task OnCopyAsync()
| Type | Description |
|---|---|
| Task |
Invoked by JS interop when a drawing body is pressed to start a move.
public Task OnDrawingMovePointerDownAsync(PointerEventArgs args)
| Type | Name | Description |
|---|---|---|
| PointerEventArgs | args |
| Type | Description |
|---|---|
| Task |
Invoked by JS interop when the pointer moves while dragging a drawing.
public Task OnDrawingMovePointerMoveAsync(PointerEventArgs args)
| Type | Name | Description |
|---|---|---|
| PointerEventArgs | args |
| Type | Description |
|---|---|
| Task |
Invoked by JS interop when the pointer is released after moving a drawing.
public Task OnDrawingMovePointerUpAsync(PointerEventArgs args)
| Type | Name | Description |
|---|---|---|
| PointerEventArgs | args |
| Type | Description |
|---|---|
| Task |
Invoked by JS interop when a drawing resize handle is pressed.
public Task<bool> OnDrawingResizePointerDownAsync(Spreadsheet.ImageResizeEventArgs args)
| Type | Name | Description |
|---|---|---|
| Spreadsheet.ImageResizeEventArgs | args |
| Type | Description |
|---|---|
| Task<bool> |
Invoked by JS interop when the pointer moves while resizing a drawing.
public Task OnDrawingResizePointerMoveAsync(PointerEventArgs args)
| Type | Name | Description |
|---|---|---|
| PointerEventArgs | args |
| Type | Description |
|---|---|
| Task |
Invoked by JS interop when the pointer is released after resizing a drawing.
public Task OnDrawingResizePointerUpAsync(PointerEventArgs args)
| Type | Name | Description |
|---|---|---|
| PointerEventArgs | args |
| Type | Description |
|---|---|
| Task |
Invoked by JS interop when a key is pressed down.
public Task OnKeyDownAsync(KeyboardEventArgs args)
| Type | Name | Description |
|---|---|---|
| KeyboardEventArgs | args |
| Type | Description |
|---|---|
| Task |
Invoked by JS interop to paste text from the clipboard into the current selection.
public Task OnPasteAsync(string text)
| Type | Name | Description |
|---|---|---|
| string | text |
| Type | Description |
|---|---|
| Task |
Invoked by JS interop when a row header is right-clicked.
public Task OnRowContextMenuAsync(Spreadsheet.CellEventArgs args)
| Type | Name | Description |
|---|---|---|
| Spreadsheet.CellEventArgs | args |
| Type | Description |
|---|---|
| Task |
Invoked by JS interop when a row header is clicked with the pointer.
public Task<bool> OnRowPointerDownAsync(Spreadsheet.CellEventArgs args)
| Type | Name | Description |
|---|---|---|
| Spreadsheet.CellEventArgs | args |
| Type | Description |
|---|---|
| Task<bool> |
Invoked by JS interop when the pointer moves over a row header.
public Task OnRowPointerMoveAsync(PointerEventArgs args)
| Type | Name | Description |
|---|---|---|
| PointerEventArgs | args |
| Type | Description |
|---|---|
| Task |
Invoked by JS interop when the row resize handle is pressed.
public Task<bool> OnRowResizePointerDownAsync(Spreadsheet.CellEventArgs args)
| Type | Name | Description |
|---|---|---|
| Spreadsheet.CellEventArgs | args |
| Type | Description |
|---|---|
| Task<bool> |
Invoked by JS interop when the pointer moves while resizing a row.
public Task OnRowResizePointerMoveAsync(PointerEventArgs args)
| Type | Name | Description |
|---|---|---|
| PointerEventArgs | args |
| Type | Description |
|---|---|
| Task |
Invoked by JS interop when the pointer is released after resizing a row.
public Task OnRowResizePointerUpAsync(PointerEventArgs args)
| Type | Name | Description |
|---|---|---|
| PointerEventArgs | args |
| Type | Description |
|---|---|
| Task |
Invoked by JS interop when the user releases the pointer after a cell, row, or column selection gesture. Fires RangeFinalized so subscribers (such as the range picker) can commit the user's pick.
public Task OnSelectionPointerUpAsync()
| Type | Description |
|---|---|
| Task |
Scrolls the spreadsheet to the specified cell address.
public Task ScrollToAsync(Documents.Spreadsheet.CellRef address)
| Type | Name | Description |
|---|---|---|
| Documents.Spreadsheet.CellRef | address |
| Type | Description |
|---|---|
| Task |
public override Task SetParametersAsync(ParameterView parameters)
| Type | Name | Description |
|---|---|---|
| ParameterView | parameters |
| Type | Description |
|---|---|
| Task |