Class
TelerikSpreadsheet

A component that enables you to create and edit spreadsheet-like workbooks with sheets, cells, and formulas. Supports toolsets for formatting and commands, file open/download workflows, context menus, dialogs, and localization.

Definition

Namespace:Telerik.Blazor.Components

Assembly:Telerik.Blazor.dll

Syntax:

cs-api-definition
public class TelerikSpreadsheet : BaseComponent, IComponent, IHandleEvent, IHandleAfterRender, IDisposable

Inheritance: objectComponentBaseBaseComponentTelerikSpreadsheet

Implements: IComponentIDisposableIHandleAfterRenderIHandleEvent

Inherited Members BaseComponent.ShouldRender()BaseComponent.OnInitializedAsync()BaseComponent.InitLocalizer()BaseComponent.ThrowIfParameterIsNull(object, string)BaseComponent.HaveOptionsChanged(IDictionary<string, object>, IDictionary<string, object>)BaseComponent.GetClassString(params string[])BaseComponent.InvokeAsync<T>(string, params object[])BaseComponent.InvokeAsync<T>(string, CancellationToken, params object[])BaseComponent.InvokeVoidAsync(string, params object[])BaseComponent.InvokeVoidAsyncWithoutAwait(string, params object[])BaseComponent.InvokeComponentMethodAsync<T>(string, params object[])BaseComponent.InvokeComponentMethodAsync<T>(string, CancellationToken, params object[])BaseComponent.InvokeVoidComponentMethodAsync(string, params object[])BaseComponent.InvokeComponentVoidMethodAsync(string, object)BaseComponent.InvokeDisposeAsync()BaseComponent.StateHasChanged()BaseComponent.RootComponentBaseComponent.ClassComponentBase.OnInitialized()ComponentBase.OnParametersSet()ComponentBase.OnAfterRender(bool)ComponentBase.InvokeAsync(Action)ComponentBase.InvokeAsync(Func<Task>)ComponentBase.DispatchExceptionAsync(Exception)ComponentBase.SetParametersAsync(ParameterView)

Constructors

TelerikSpreadsheet()

Declaration

cs-api-definition
public TelerikSpreadsheet()

Properties

ColumnHeaderHeight

Sets the height of the column headers in pixels. Example: ColumnHeaderHeight = 24.

Declaration

cs-api-definition
[Parameter]
public double ColumnHeaderHeight { get; set; }

Property Value

double

ColumnWidth

Sets the default width of columns in pixels. Example: ColumnWidth = 80. Changing this affects all columns unless overridden per column.

Declaration

cs-api-definition
[Parameter]
public double ColumnWidth { get; set; }

Property Value

double

ColumnsCount

Sets the number of columns in each sheet. Example: ColumnsCount = 100. Increasing this value may impact performance for very large sheets.

Declaration

cs-api-definition
[Parameter]
public int ColumnsCount { get; set; }

Property Value

int

Data

Provides the file data to load into the Spreadsheet. Set this to a valid Excel file byte array to open a file programmatically. Example: Data = myFileBytes.

Declaration

cs-api-definition
[Parameter]
public byte[] Data { get; set; }

Property Value

byte[]

EnableLoaderContainer

Shows a loading indicator during long-running operations, such as file import or export. Set to false to disable the loader. Example: EnableLoaderContainer = false.

Declaration

cs-api-definition
[Parameter]
public bool EnableLoaderContainer { get; set; }

Property Value

bool

EnableWebMcpTools

Enables the registration of WebMCP tools for this Spreadsheet instance. When set to true, Spreadsheet operations are exposed as tools discoverable by AI models through the browser. Default value is false.

Declaration

cs-api-definition
[Parameter]
public bool EnableWebMcpTools { get; set; }

Property Value

bool

Height

Sets the height of the Spreadsheet component. Accepts CSS values such as "600px" or "100%". Example: Height = "400px".

Declaration

cs-api-definition
[Parameter]
public string Height { get; set; }

Property Value

string

OnDownload

Fires when a file is downloaded from the Spreadsheet. Use to handle custom logic after file export. Example: OnDownload = EventCallback.Factory.Create(this, OnSpreadsheetDownload).

Declaration

cs-api-definition
[Parameter]
public EventCallback<SpreadsheetDownloadEventArgs> OnDownload { get; set; }

Property Value

EventCallback<SpreadsheetDownloadEventArgs>

OnOpen

Fires when a file is opened in the Spreadsheet. Use to handle custom logic after file load. Example: OnOpen = EventCallback.Factory.Create(this, OnSpreadsheetOpen).

Declaration

cs-api-definition
[Parameter]
public EventCallback<SpreadsheetOpenEventArgs> OnOpen { get; set; }

Property Value

EventCallback<SpreadsheetOpenEventArgs>

RowHeaderWidth

Sets the width of the row headers in pixels. Example: RowHeaderWidth = 40.

Declaration

cs-api-definition
[Parameter]
public double RowHeaderWidth { get; set; }

Property Value

double

RowHeight

Sets the default height of rows in pixels. Example: RowHeight = 24. Required for some features such as virtual scrolling.

Declaration

cs-api-definition
[Parameter]
public double RowHeight { get; set; }

Property Value

double

RowsCount

Sets the number of rows in each sheet. Example: RowsCount = 500. Large values may affect performance.

Declaration

cs-api-definition
[Parameter]
public int RowsCount { get; set; }

Property Value

int

SpreadsheetSettings

Provides configuration for WebMCP tools, such as a Name to distinguish this Spreadsheet from others on the same page.

Declaration

cs-api-definition
[Parameter]
public RenderFragment SpreadsheetSettings { get; set; }

Property Value

RenderFragment

Tools

Configures the visible toolbars and tools in the Spreadsheet. Use All for all tools or customize with a SpreadsheetToolSet. Example: Tools = SpreadsheetToolSets.All.

Declaration

cs-api-definition
[Parameter]
public SpreadsheetToolSet Tools { get; set; }

Property Value

SpreadsheetToolSet

Width

Sets the width of the Spreadsheet component. Accepts CSS values like "800px" or "100%". Example: Width = "100%".

Declaration

cs-api-definition
[Parameter]
public string Width { get; set; }

Property Value

string

Methods

BuildRenderTree(RenderTreeBuilder)

Declaration

cs-api-definition
protected override void BuildRenderTree(RenderTreeBuilder __builder)

Parameters

__builder

RenderTreeBuilder

Overrides ComponentBase.BuildRenderTree(RenderTreeBuilder)

Dispose()

Declaration

cs-api-definition
public override void Dispose()

Overrides BaseComponent.Dispose()

ExportToExcelAsync()

Exports the Spreadsheet to raw data.

Declaration

cs-api-definition
public Task<byte[]> ExportToExcelAsync()

Returns

Task<byte[]>

InitJsComponentAsync()

Declaration

cs-api-definition
protected Task InitJsComponentAsync()

Returns

Task

OnAfterRenderAsync(bool)

Declaration

cs-api-definition
protected override Task OnAfterRenderAsync(bool firstRender)

Parameters

firstRender

bool

Returns

Task

Overrides BaseComponent.OnAfterRenderAsync(bool)

OnParametersSetAsync()

Declaration

cs-api-definition
protected override Task OnParametersSetAsync()

Returns

Task

Overrides ComponentBase.OnParametersSetAsync()

Rebind()

Updates the component and processes the latest file data.

Declaration

cs-api-definition
public void Rebind()

Refresh()

Refreshes the component.

Declaration

cs-api-definition
public void Refresh()