Skip to main content
All docs
V24.1

TableStyleName.GridTable7ColorfulAccent1 Property

Returns the name of the Grid Table 7 Colorful Accent 1 style.

Namespace: DevExpress.Blazor.RichEdit

Assembly: DevExpress.Blazor.RichEdit.v24.1.dll

NuGet Package: DevExpress.Blazor.RichEdit

Declaration

public static string GridTable7ColorfulAccent1 { get; }

Property Value

Type Description
String

The "Grid Table 7 Colorful Accent 1" string.

Remarks

Pass a TableProperties instance to the ChangePropertiesAsync method to customize table appearance. Use properties of the TableStyleName class to obtain table style names. Assign a style name to the TableProperties.StyleName property to apply this style to the table. Specify TableProperties.TableStyleOptions to apply/remove special formatting to/from the first, last, and odd columns and rows.

The following example applies the Grid Table 7 Colorful Accent 1 style to a table:

<DxRichEdit @ref="richEdit" />

@code {
    DxRichEdit richEdit;
    protected override async Task OnAfterRenderAsync(bool firstRender) {
        if (firstRender)
            try {
                await InitializeDocument();
            }
            catch (TaskCanceledException) { }
        await base.OnAfterRenderAsync(firstRender);
    }

    async Task InitializeDocument() {
    /* Surround the code that contains an asynchronous operation with a try-catch block to handle
    the OperationCanceledException. This exception is thrown when an asynchronous operation is canceled. */
        try {
            var columnCount = 4;
            var rowCount = 5;
            richEdit.DocumentAPI.BeginUpdate();
            // Creates a table
            Table myTable = await richEdit.DocumentAPI.Tables.CreateAsync(0, columnCount, rowCount);
            for (int i = rowCount-1; i >= 0 ; i--)
                for (int j = columnCount-1; j >= 0 ; j--) {
                    var cellPosition = myTable.Rows[i].Cells[j].Interval.Start;
                    await richEdit.DocumentAPI.AddTextAsync(cellPosition, "sample text");
                }
            // Customizes the table
            await myTable.ChangePropertiesAsync(properties => {
                properties.StyleName = TableStyleName.GridTable7ColorfulAccent1;
            });
            richEdit.DocumentAPI.EndUpdate();
        }
        catch (OperationCanceledException e) {
            Console.WriteLine($"{nameof(OperationCanceledException)} thrown with message: {e.Message}");
        }
    }
}
See Also