Back to Devexpress

Section.ColumnCount Property

blazor-devexpress-dot-blazor-dot-richedit-dot-section-1e6f45d2.md

latest1.9 KB
Original Source

Section.ColumnCount Property

Returns the number of columns in the section.

Namespace : DevExpress.Blazor.RichEdit

Assembly : DevExpress.Blazor.RichEdit.v25.2.dll

NuGet Package : DevExpress.Blazor.RichEdit

Declaration

csharp
public int ColumnCount { get; }

Property Value

TypeDescription
Int32

The number of columns.

|

Remarks

Call the section’s ChangePropertiesAsync(Action<SectionProperties>, CancellationToken) method to change the number of columns in the section.

razor
<DxRichEdit @ref="richEdit" />

@code {
    DxRichEdit richEdit;
    Document documentAPI;
    /* 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 {
            documentAPI = richEdit.DocumentAPI;
            var sections = await documentAPI.Sections.GetAllAsync();
            foreach (Section s in sections)
                await s.ChangePropertiesAsync(properties => {
                    if (s.ColumnCount != 3)
                        properties.ColumnCount = 3;
                });
        }
        catch (OperationCanceledException e) {
            Console.WriteLine($"{nameof(OperationCanceledException)} thrown with message: {e.Message}");
        }
}

See Also

Section Class

Section Members

DevExpress.Blazor.RichEdit Namespace