# CellTypeDefinition Class

> CellTypeDefinition class in the TX Sheet Control .NET API: Portable cell UI settings. Covers 1 constructor and 7 properties and a C# example.

- **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)
- **Implements:** `System.IEquatable<TXTextControl.TXSheetControl.Server.CellTypeDefinition>`
- **Path:** TX Sheet Control > API Reference > .NET API > TXTextControl.TXSheetControl.Server > CellTypeDefinition Class
- **1274 words**
- **Web URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/celltypedefinition/
- **LLMs URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/celltypedefinition/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/celltypedefinition/llms-full.txt

---

Portable cell UI settings. Custom renderer callbacks are registered separately and never serialized.

### Syntax

```csharp
public class CellTypeDefinition
```

Interfaces: `IEquatable<CellTypeDefinition>`.

### Members

#### Constructors

| Constructor | Description |
|---|---|
| [Constructor](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/celltypedefinition/constructor/llms-full.txt) |  |

#### Properties

| Property | Description |
|---|---|
| [AllowCustomValue](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/celltypedefinition/allowcustomvalue-property/llms-full.txt) |  |
| [Items](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/celltypedefinition/items-property/llms-full.txt) |  |
| [Mask](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/celltypedefinition/mask-property/llms-full.txt) |  |
| [Options](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/celltypedefinition/options-property/llms-full.txt) |  |
| [Renderer](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/celltypedefinition/renderer-property/llms-full.txt) |  |
| [Text](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/celltypedefinition/text-property/llms-full.txt) |  |
| [Type](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/celltypedefinition/type-property/llms-full.txt) |  |

### Examples

Apply CellTypeDefinition to a small working document, then return the exported bytes. The caller can save or download the result.

```csharp
using TXTextControl.TXSheetControl.Server;

async Task<byte[]> CreateCellTypeDefinitionReportAsync(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)");
    await sheet.Cell("A1").SetTextAsync("October invoice");
    await sheet.Cell("A1").FormatAsync(new { fontFamily = "Liberation Sans", fontSize = 16, bold = true, textColor = "#ffffff", fillColor = "#163b63" });
    await sheet.Range("B8:B10").FormatAsync(new { numberFormatCode = "#,##0.00", fontFamily = "Liberation Sans", fontSize = 11 });

    var settings = new CellTypeDefinition()
    {
        Items = new CellTypeItem[] { new CellTypeItem { Text = "North", Value = "North" }, new CellTypeItem { Text = "South", Value = "South" } },
        Type = "comboBox"
    };

    await sheet.Cell("C8").SetCellTypeAsync(settings);
    await sheet.Cell("C8").SetTextAsync("North");
    return await control.SaveAsync(StreamType.InternalWorkbookFormat);
}
```

### 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

- [CellTypeDefinition.AllowCustomValue Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/celltypedefinition/allowcustomvalue-property/llms-full.txt): CellTypeDefinition.AllowCustomValue property in the TX Sheet Control .NET API, with its syntax, its type bool? and a C# example.
- [CellTypeDefinition Constructor](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/celltypedefinition/constructor/llms-full.txt): CellTypeDefinition constructor in the TX Sheet Control .NET API, with its syntax, a C# example and remarks on awaiting tasks and handles.
- [CellTypeDefinition.Items Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/celltypedefinition/items-property/llms-full.txt): CellTypeDefinition.Items property in the TX Sheet Control .NET API, with its syntax, its type CellTypeItem[] and a C# example.
- [CellTypeDefinition.Mask Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/celltypedefinition/mask-property/llms-full.txt): CellTypeDefinition.Mask property in the TX Sheet Control .NET API, with its syntax, its type string?, a C# example and remarks on awaiting tasks and handles.
- [CellTypeDefinition.Options Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/celltypedefinition/options-property/llms-full.txt): CellTypeDefinition.Options property in the TX Sheet Control .NET API, with its type Dictionary<string, object?>? and a C# example.
- [CellTypeDefinition.Renderer Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/celltypedefinition/renderer-property/llms-full.txt): CellTypeDefinition.Renderer property in the TX Sheet Control .NET API, with its syntax, its type string? and a C# example.
- [CellTypeDefinition.Text Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/celltypedefinition/text-property/llms-full.txt): CellTypeDefinition.Text property in the TX Sheet Control .NET API, with its syntax, its type string?, a C# example and remarks on awaiting tasks and handles.
- [CellTypeDefinition.Type Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/celltypedefinition/type-property/llms-full.txt): CellTypeDefinition.Type property in the TX Sheet Control .NET API, with its syntax, its type string, a C# example and remarks on awaiting tasks and handles.

---

## Nearby

- **Previous:** [CellTextStyle.Underline Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/celltextstyle/underline-property/llms-full.txt)
- **Next:** [CellTypeDefinition Constructor](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/celltypedefinition/constructor/llms-full.txt)
