TX Sheet Control

ValidationFailure.Message Property

Property
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

Syntax

public string Message { get; init; }

Property Value

string.

Examples

Create a working document workflow using ValidationFailure. Return the generated document or application data to the caller.

using TXTextControl.TXSheetControl.Server;

async Task<string[]> BuildValidationFailureMessageAsync(ServerSheetControl control)
{
    var book = control.Workbook;
    var sheet = await book.Sheets.AtAsync(0);
    await sheet.Cell("B8").SetValueAsync(-5);
    await sheet.Validation.SetAsync("B8:B9", new ValidationRule { Type = "decimal", Operator = "between", Formula1 = "0", Formula2 = "10000", ErrorMessage = "Enter an amount between 0 and 10000." });

    var failures = await sheet.Validation.CheckAsync("B8");
    return failures.Select(failure => failure.Address + ": " + failure.Message).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.

See Also