# CellTypes Class

> CellTypes class in the TX Sheet Control .NET API: Registers SVG cell renderers shared with the independent PDF painter. Covers 2 methods 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)
- **Path:** TX Sheet Control > API Reference > .NET API > TXTextControl.TXSheetControl.Server > CellTypes Class
- **820 words**
- **Web URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/celltypes/
- **LLMs URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/celltypes/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/celltypes/llms-full.txt

---

Registers SVG cell renderers shared with the independent PDF painter.

### Syntax

```csharp
public class CellTypes
```

### Members

#### Methods

| Method | Description |
|---|---|
| [RegisterRendererAsync](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/celltypes/registerrendererasync-method/llms-full.txt) | Registers a named renderer returning portable SVG. Callbacks must not reenter the control. |
| [RemoveRendererAsync](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/celltypes/removerendererasync-method/llms-full.txt) | Removes the renderer and releases its host callback. |

### 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[]> CreateCellTypesReportAsync(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 cellTypes = book.CellTypes;
    await cellTypes.RegisterRendererAsync("approval", _ => """<svg xmlns="http://www.w3.org/2000/svg" width="80" height="20"><text x="2" y="15">Approved</text></svg>""");
    await sheet.Cell("C8").SetCellTypeAsync(new CellTypeDefinition { Type = "custom", Renderer = "approval" });
    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

- [CellTypes.RegisterRendererAsync Method](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/celltypes/registerrendererasync-method/llms-full.txt): CellTypes.RegisterRendererAsync method in the TX Sheet Control .NET API: Registers a named renderer returning portable SVG.
- [CellTypes.RemoveRendererAsync Method](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/celltypes/removerendererasync-method/llms-full.txt): CellTypes.RemoveRendererAsync method in the TX Sheet Control .NET API: Removes the renderer and releases its host callback.

---

## Nearby

- **Previous:** [CellTypeItem.Value Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/celltypeitem/value-property/llms-full.txt)
- **Next:** [CellTypes.RegisterRendererAsync Method](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/celltypes/registerrendererasync-method/llms-full.txt)
