WorkbookEventArgs.Address Property
- Namespace
TXTextControl.TXSheetControl. Server
- Package
TXTextControl.asTXSheetControl. Server TXTextControl.from the private NuGet feed or the supplied NuGet folderTXSheetControl. Api. dll
- Also in
TXTextControl.asTXSheetControl. Blazor TXTextControl.TXSheetControl. Api. dll
Single-cell address for interaction and editing events.
Syntax
public string? Address { get; init; }
Property Value
string?.
Examples
Subscribe while processing a document and return detached notifications for the application UI or audit trail. Handlers are synchronous: do not call document methods inside them. Only matching operations raise the selected event.
using System.Text.Json;
using TXTextControl.TXSheetControl.Server;
async Task<string[]> CaptureReportNotificationsAsync(ServerSheetControl control)
{
var book = control.Workbook;
var sheet = await book.Sheets.AtAsync(0);
var events = new List<string>();
void OnNotification(object? sender, WorkbookEventArgs args)
{
events.Add(JsonSerializer.Serialize(args.Address));
}
book.Events.Changed += OnNotification;
try
{
await sheet.Cell("A1").SetTextAsync("October invoice");
await sheet.Cell("A1").FormatAsync(new { fontFamily = "Liberation Sans", fontSize = 16, bold = true, textColor = "#ffffff", fillColor = "#163b63" });
await control.SaveAsync(StreamType.PDF);
}
finally
{
book.Events.Changed -= OnNotification;
}
return events.ToArray();
}
Remarks
Use the member with an instance or settings object from the documented package. Await task-returning operations. Document-bound handles must be resolved again after loading or deleting their owner.