Skip to main content
A newer version of this page is available. .

Sections Class

Contains members that allow you to manage a document’s sections.

Namespace: DevExpress.Blazor.RichEdit

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

NuGet Package: DevExpress.Blazor.RichEdit

Declaration

public class Sections :
    ElementCollection<Section>

The following members return Sections objects:

Remarks

Use the Sections property to access an object of the Sections type. This object contains methods to create and find sections.

<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 cancelled. */
        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}");
        }
}

Inheritance

See Also