ValidationFailure 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
- Implements
- IEquatable<Validation
Failure>
Detached cell validation failure; stop-style violations roll back the entire attempted transaction.
Syntax
public class ValidationFailure
Interfaces: IEquatable<ValidationFailure>.
Members
Constructors
| Constructor | Description |
|---|---|
| Constructor |
Properties
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[]> BuildValidationFailureExampleAsync(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();
}