ListType Enum

Lists values that specify the list type.

Namespace: DevExpress.Blazor.RichEdit

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

Declaration

public enum ListType

Members

Name Description
MultiLevel

The multilevel list.

Number

The numbered list.

Bullet

The bulleted list.

Related API Members

The following properties accept/return ListType values:

Remarks

Pass a ListType enumeration’s value to the CreateAsync(ListType) method to create a list of the specified type. Use a list’s Type property value to get the type of the list.

<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;
            @* ... *@
            List list = await documentAPI.Lists.CreateAsync(ListType.MultiLevel);
            IReadOnlyList<ListLevel> listLevels = list.ListLevels;
            ListLevel firstLevel = listLevels[0];
            @* ... *@
            for (int i = 1; i < 9; i++)
                await list.ChangeLevelPropertiesAsync(i, properties => {
                    properties.CopyFrom(firstLevel);
                    properties.LeftIndent = firstLevel.LeftIndent + 300 * i;
                    if (list.Type == ListType.Number)
                        properties.DisplayFormatString = "{" + i.ToString() + "}";
                });
                @* ... *@
        }
        catch (OperationCanceledException e) {
            Console.WriteLine($"{nameof(OperationCanceledException)} thrown with message: {e.Message}");
        }
}

The type of a list defines the default property values for all list levels. Call the ChangeLevelPropertiesAsync(Int32, Action<ListLevelProperties>) method to change a list level’s properties.

See Also