TX Sheet Control

TableOptions.CustomStyle Property

Property
Namespace
TXTextControl.TXSheetControl.Server
Package
TXTextControl.TXSheetControl.Server as TXTextControl.TXSheetControl.Api.dll from the private NuGet feed or the supplied NuGet folder
Also in
TXTextControl.TXSheetControl.Blazor as TXTextControl.TXSheetControl.Api.dll

Named custom table recipe containing name and elements. Each element supplies type, optional stripe size and sparse formatting. The recipe applies while its name matches Style; omitted recipes use built-in styles.

Syntax

public object? CustomStyle { get; init; }

A named sparse table recipe. It applies while its name matches style. Direct formatting overrides table formatting; conditional rules have highest priority. See Tables for recipe roles and precedence. Validation errors reject the asynchronous operation without changing the table.

Example

using TXTextControl.TXSheetControl.Server;

async Task ApplyBudgetStyle(Table table, CancellationToken cancellationToken)
{
    await table.UpdateAsync(new TableOptions {
        Style = "Budget",
        CustomStyle = new { name = "Budget", elements = new[] {
            new { type = "headerRow", formatting = new { bold = true, fillColor = "#a4d4b4" } },
            new { type = "wholeTable", formatting = new { bold = false, fillColor = "#f2f2f2" } }
        } }
    }, cancellationToken);
}