Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

ListLevel.DisplayFormatString Property

Gets the pattern used to format the list level’s number or bullet.

Namespace: DevExpress.Blazor.RichEdit

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

NuGet Package: DevExpress.Blazor.RichEdit

#Declaration

C#
public string DisplayFormatString { get; }

#Property Value

Type Description
String

The format pattern.

#Remarks

The format pattern can include fixed literals and indexed placeholders.

An indexed placeholder is an integer from 0 to 8 enclosed in curly brackets (for instance, “{0}”). A placeholder index corresponds to the list level’s number or bullet depending on the ListLevelFormat property value.

Use the list’s ChangeLevelPropertiesAsync(Int32, Action<ListLevelProperties>, CancellationToken) method to change the format pattern of a list level. The following example shows how you can set the ◆ bullet for the 0 list level.

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;
            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