TX Sheet Control

Search.FindAsync Method

Method
Namespace
TXTextControl.TXSheetControl.Server
Package
TXTextControl.TXSheetControl.Server as TXTextControl.TXSheetControl.Api.dll from the private NuGet feed or the supplied NuGet folder
Also in
TXTextControl.TXSheetControl.Blazor as 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

ParameterTypeOptionalDescription
optionsSearchOptionsNoSupported settings for this operation; omitted settings retain documented defaults.
cancellationTokenCancellationTokenYesCancels 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.

See Also