Comments Class
- Namespace
TXTextControl.TXSheetControl. Server
- Package
TXTextControl.from the private NuGet feed or the supplied NuGet folderTXSheetControl. Server
- Assembly
TXTextControl.TXSheetControl. Api. dll
- Install
dotnet add package TXTextControl..NET 10 and later.TXSheetControl. Server
- Also in
TXTextControl.asTXSheetControl. Blazor TXTextControl.TXSheetControl. Api. dll
- Inherits
- Document
Object - Comments
- Document
One cell conversation; new entries use the owner's current userName and preserve original author metadata.
Syntax
public class Comments
Members
Methods
| Method | Description |
|---|---|
| AddAsync | Starts a thread or appends a reply using the current runtime userName. |
| EditAsync | Edits an entry owned by the current author, retaining its original creation time. |
| GetThreadAsync | Reads the detached conversation, or null when the cell has no comments. |
| RemoveAsync | Removes an authored entry, or the complete cell conversation when omitted. |
| ResolveAsync | Resolves or reopens a thread without rewriting its entries. |
Examples
Build a small report using this document API and return its PDF bytes. Pass a live control with a fresh workbook; the caller owns its lifetime.
using TXTextControl.TXSheetControl.Server;
async Task<byte[]> CreateCommentsReportAsync(ServerSheetControl control)
{
var book = control.Workbook;
var sheet = await book.Sheets.AtAsync(0);
await sheet.Cell("B8").SetValueAsync(120);
await sheet.Cell("B9").SetValueAsync(80);
await sheet.Cell("B10").SetFormulaAsync("=SUM(B8:B9)");
var comments = sheet.Cell("B10").Comments;
var commentId = await comments.AddAsync("Please review this invoice total.");
await comments.ResolveAsync();
return await control.SaveAsync(StreamType.PDF);
}