# Validation Class

> Validation class in the TX Sheet Control .NET API: Worksheet data validation, including source lists, constraints, messages and atomic edit enforcement.

- **Product:** TX Sheet Control
- **Section:** Documentation
- **Kind:** Class
- **Namespace:** `TXTextControl.TXSheetControl.Server`
- **Package:** `TXTextControl.TXSheetControl.Server` (assembly `TXTextControl.TXSheetControl.Api.dll`, from the private NuGet feed or the supplied NuGet folder)
- **Package:** `TXTextControl.TXSheetControl.Blazor` (assembly `TXTextControl.TXSheetControl.Api.dll`, from the private NuGet feed or the supplied NuGet folder)
- **Inherits:** `TXTextControl.TXSheetControl.Server.DocumentObject`
- **Path:** TX Sheet Control > API Reference > .NET API > TXTextControl.TXSheetControl.Server > Validation Class
- **867 words**
- **Web URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/validation/
- **LLMs URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/validation/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/validation/llms-full.txt

---

Worksheet data validation, including source lists, constraints, messages and atomic edit enforcement.

### Syntax

```csharp
public class Validation
```

### Members

#### Methods

| Method | Description |
|---|---|
| [CheckAsync](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/validation/checkasync-method/llms-full.txt) | Checks the current cell value without changing it or displaying a user interface. |
| [ChoicesAsync](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/validation/choicesasync-method/llms-full.txt) | Reads list choices, including named and range-based validation sources. |
| [ListAsync](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/validation/listasync-method/llms-full.txt) | Returns detached validation definitions without mutating current values. |
| [RemoveAsync](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/validation/removeasync-method/llms-full.txt) | Removes a rule by identity, or all worksheet rules when omitted. |
| [SetAsync](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/validation/setasync-method/llms-full.txt) | Sets a rule for an A1 range; subsequent editor and server edits are validated. |

### Examples

Build a small report using this document API and return its PDF bytes. Pass a live control with a fresh workbook; the caller owns its lifetime.

```csharp
using TXTextControl.TXSheetControl.Server;

async Task<byte[]> CreateValidationReportAsync(ServerSheetControl control)
{
    var book = control.Workbook;
    var sheet = await book.Sheets.AtAsync(0);
    await sheet.Cell("B8").SetValueAsync(120);
    await sheet.Cell("B9").SetValueAsync(80);
    await sheet.Cell("B10").SetFormulaAsync("=SUM(B8:B9)");

    var validation = sheet.Validation;
    await validation.SetAsync("B8:B9", new ValidationRule { Type = "decimal", Operator = "between", Formula1 = "0", Formula2 = "10000" });
    return await control.SaveAsync(StreamType.PDF);
}
```

### See Also

- [TXTextControl.TXSheetControl.Server Namespace](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/llms-full.txt)
- [Data Validation](https://docs.textcontrol.com/tx-sheet-control/spreadsheets/validation/llms-full.txt)

---

## In This Section

- [Validation.CheckAsync Method](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/validation/checkasync-method/llms-full.txt): Validation.CheckAsync method in the TX Sheet Control .NET API: Checks the current cell value without changing it or displaying a user interface.
- [Validation.ChoicesAsync Method](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/validation/choicesasync-method/llms-full.txt): Validation.ChoicesAsync method in the TX Sheet Control .NET API: Reads list choices, including named and range-based validation sources.
- [Validation.ListAsync Method](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/validation/listasync-method/llms-full.txt): Validation.ListAsync method in the TX Sheet Control .NET API: Returns detached validation definitions without mutating current values.
- [Validation.RemoveAsync Method](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/validation/removeasync-method/llms-full.txt): Validation.RemoveAsync method in the TX Sheet Control .NET API: Removes a rule by identity, or all worksheet rules when omitted.
- [Validation.SetAsync Method](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/validation/setasync-method/llms-full.txt): Validation.SetAsync method in the TX Sheet Control .NET API: Sets a rule for an A1 range; subsequent editor and server edits are validated.

---

## Nearby

- **Previous:** [TabularSaveOptions.SheetName Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/tabularsaveoptions/sheetname-property/llms-full.txt)
- **Next:** [Validation.CheckAsync Method](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/validation/checkasync-method/llms-full.txt)
