Skip to main content

ListLevel.LeftIndent Property

Get’s the left indent of the list level’s paragraphs.

Namespace: DevExpress.Blazor.RichEdit

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

NuGet Package: DevExpress.Blazor.RichEdit

Declaration

public int LeftIndent { get; }

Property Value

Type Description
Int32

The left indent, in twips.

Remarks

Use the list’s ChangeLevelPropertiesAsync(Int32, Action<ListLevelProperties>, CancellationToken) method to change the left indent of a list level’s paragraphs.

<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.LeftIndent != 200)
                    properties.LeftIndent = 200;
            });
        }
        catch (OperationCanceledException e) {
            Console.WriteLine($"{nameof(OperationCanceledException)} thrown with message: {e.Message}");
        }
}

Use methods of the UnitConverter class to convert centimeters, inches, pixels, or points to twips.

The LeftIndent property is not in effect for the list level’s paragraph when the paragraph’s LeftIndent property is set to a value other than 0.

See Also