ValidationFailure.Rule Property
- 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 ValidationRule Rule { get; init; }
Property Value
ValidationRule.
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[]> BuildValidationFailureRuleAsync(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.