WorkbookEvents.Edited Event
- 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
Syntax
public event EventHandler<WorkbookEventArgs> Edited
Event Type
EventHandler<WorkbookEventArgs>.
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 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(args.Name + ": " + string.Join(", ", args.Addresses));
}
book.Events.Edited += 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.Edited -= 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.