Skip to main content

List.ListLevels Property

Provides access to list level properties.

Namespace: DevExpress.Blazor.RichEdit

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

NuGet Package: DevExpress.Blazor.RichEdit

Declaration

public IReadOnlyList<ListLevel> ListLevels { get; }

Property Value

Type Description
IReadOnlyList<ListLevel>

A collection of list levels.

Remarks

A list includes 9 nesting levels from 0 to 8. A list’s Type property defines the default settings for all list levels. Call the ChangeLevelPropertiesAsync(Int32, Action<ListLevelProperties>, CancellationToken) method to change a list level’s properties.

<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;
            List multiLevelList = await documentAPI.Lists.CreateAsync(ListType.MultiLevel);
            IReadOnlyList<ListLevel> listLevels = multiLevelList.ListLevels;
            ListLevel firstLevel = listLevels[0];
            await multiLevelList.ChangeLevelPropertiesAsync(0, properties => {
                if (firstLevel.DisplayFormatString != "\u25C6")
                    properties.DisplayFormatString = "\u25C6";
            });
        }
        catch (OperationCanceledException e) {
            Console.WriteLine($"{nameof(OperationCanceledException)} thrown with message: {e.Message}");
        }
}
See Also