Search.FindAsync Method
- 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
Returns stable worksheet/row-major matches; maxResults is bounded to protect large workbooks.
Syntax
public Task<SearchMatch[]> FindAsync(SearchOptions options, CancellationToken cancellationToken = default)
Parameters
| Parameter | Type | Optional | Description |
|---|---|---|---|
options | SearchOptions | No | Supported settings for this operation; omitted settings retain documented defaults. |
cancellationToken | CancellationToken | Yes | Cancels waiting or execution as supported by this operation. |
Return Value
Task<SearchMatch[]>.
Examples
Create the sample document data first, then use Search.FindAsync. The returned value can be used by the calling report or application.
using TXTextControl.TXSheetControl.Server;
async Task<SearchMatch[]> UseSearchFindAsync(ServerSheetControl control)
{
var book = control.Workbook;
var sheet = await book.Sheets.AtAsync(0);
await sheet.Cell("A1").SetTextAsync("Consulting");
var search = book.Search;
var result = await search.FindAsync(new SearchOptions { MatchCase = false });
return result;
}
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.