TX Sheet Control

BlazorSheetControl Class

Class
Namespace
TXTextControl.TXSheetControl.Blazor
Package
TXTextControl.TXSheetControl.Blazor from the private NuGet feed or the supplied NuGet folder
Assembly
TXTextControl.TXSheetControl.Blazor.dll
Install
dotnet add package TXTextControl.TXSheetControl.Blazor .NET 10 and later.
Implements
IAsyncDisposable, ISheetControl

Browser document host implementing the same typed Workbook API as ServerSheetControl. Use after the component Ready event.

Syntax

public class BlazorSheetControl

Members

MemberDescription
BatchAsyncApplies collected workbook commands as one atomic undoable transaction.
DisposeAsyncReleases the editor, its event subscriptions and this instance's callback reference. Safe to call repeatedly.
EventsShared completed workbook notifications. Browser events cannot synchronously cancel an edit.
GetLicenseInfoAsyncReads current signed license metadata, including the current trial deadline state.
GetPrintLayoutAsyncCalculates detached print layout metadata for the selected worksheet.
GetSelectionAsyncReads detached current screen selection.
GetUserNameAsyncReads the current comment author using the same signature as ServerSheetControl.
GetWarningsAsyncReads text from retained XLSX conversion notices.
GetXlsxWarningsAsyncReads detached XLSX conversion notices from the browser document.
LoadAsyncLoads copied binary input atomically. The caller retains ownership of the byte array.
LoadTextAsyncLoads UTF-8 CSV, XML or JSON text with the same reusable options as the server API.
MergeAsyncMerges application data into this document through the shared engine.
SaveAsyncExports caller-owned bytes through Blazor streaming. PDF, XLSX, ODS and TXWB use the shared document engine.
SaveTextAsyncExports CSV, XML or JSON text. Binary formats require SaveAsync.
SelectRangeAsyncSelects a worksheet-bound A1 range and scrolls it into view. Foreign handles are rejected.
SetPrintContextAsyncSets print-field context for subsequent exports.
SetUserNameAsyncSets a nonempty comment author for subsequent comments.
WorkbookShared typed document API. Handles become stale after loading a replacement workbook.

Examples

The control variable is the host received by Ready. File examples use caller-provided xlsxBytes.

var sheet = await control.Workbook.Sheets.AtAsync(0);
await sheet.Cell("A1").SetValueAsync("Orders");
await sheet.Cell("B2").SetValueAsync(8);
await sheet.Cell("D2").SetFormulaAsync("=B2*12");

Remarks

Use the component only after interactive rendering. Browser document operations execute in the editor through JavaScript interop. Completed notifications cannot synchronously cancel edits.

See Also