officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-numberinglistbase-691ee40d.md
Provides access to a collection of list levels.
Namespace : DevExpress.XtraRichEdit.API.Native
Assembly : DevExpress.RichEdit.v25.2.Core.dll
NuGet Package : DevExpress.RichEdit.Core
ReadOnlyListLevelCollection<ListLevel> Levels { get; }
ReadOnly Property Levels As ReadOnlyListLevelCollection(Of ListLevel)
| Type | Description |
|---|---|
| DevExpress.XtraRichEdit.API.Native.ReadOnlyListLevelCollection<ListLevel> |
A DevExpress.XtraRichEdit.API.Native.ReadOnlyListLevelCollection<T> collection of level definitions.
|
The list levels’ collection contains 9 items regardless of the list type. The ListLevel class represents a list level.
The ListLevelProperties.DisplayFormatString property defines a format string for a list item’s marker. Specify the ListLevelProperties.NumberingFormat property to define the number format for the marker.
The ListLevel.CharacterProperties and ListLevel.ParagraphProperties properties provide access to the format options.
Document document = server.Document;
document.BeginUpdate();
// Create a new list pattern object
AbstractNumberingList list = document.AbstractNumberingLists.Add();
//Specify the list's type
list.NumberingType = NumberingType.Bullet;
ListLevel level = list.Levels[0];
//Set the left indent of the list
level.ParagraphProperties.LeftIndent = 100;
//Specify the bullets' format
//Without this step, the list is considered as numbered
level.DisplayFormatString = "\u00B7";
level.CharacterProperties.FontName = "Symbol";
//Create a new list based on the specific pattern
NumberingList bulletedList = document.NumberingLists.Add(0);
// Add paragraphs to the list
ParagraphCollection paragraphs = document.Paragraphs;
paragraphs.AddParagraphsToList(document.Range, bulletedList, 0);
document.EndUpdate();
Dim document As Document = server.Document
document.BeginUpdate()
' Create a new list pattern objects
Dim list As AbstractNumberingList = document.AbstractNumberingLists.Add()
' Specify the list's type
list.NumberingType = NumberingType.Bullet
Dim level As ListLevel = list.Levels(0)
' Set the left indent of the list
level.ParagraphProperties.LeftIndent = 100
' Specify the bullet's format
' Without this step, the list is considered as numbered
level.DisplayFormatString = "·"
level.CharacterProperties.FontName = "Symbol"
' Create a new list based on the specific pattern
Dim bulletedList as NumberingList = document.NumberingLists.Add(0)
' Add paragraphs to the list
Dim paragraphs As ParagraphCollection = document.Paragraphs
paragraphs.AddParagraphsToList(document.Range, bulletedList, 0)
document.EndUpdate()
The following code snippets (auto-collected from DevExpress Examples) contain references to the Levels property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
winforms-richedit-document-api/CS/RichEditAPISample/CodeExamples/List.cs#L23
list.NumberingType = NumberingType.Bullet;
ListLevel level = list.Levels[0];
level.ParagraphProperties.LeftIndent = 100;
wpf-richedit-document-api/CS/DXRichEditControlAPISample/CodeExamples/ListActions.cs#L23
list.NumberingType = NumberingType.Bullet;
ListLevel level = list.Levels[0];
level.ParagraphProperties.LeftIndent = 100;
word-document-api-examples/CS/CodeExamples/ListsActions.cs#L35
// Access the first list level.
ListLevel level = list.Levels[0];
winforms-richedit-document-api/VB/RichEditAPISample/CodeExamples/List.vb#L20
list.NumberingType = DevExpress.XtraRichEdit.API.Native.NumberingType.Bullet
Dim level As DevExpress.XtraRichEdit.API.Native.ListLevel = list.Levels(0)
level.ParagraphProperties.LeftIndent = 100
wpf-richedit-document-api/VB/DXRichEditControlAPISample/CodeExamples/ListActions.vb#L20
list.NumberingType = NumberingType.Bullet
Dim level As ListLevel = list.Levels(0)
level.ParagraphProperties.LeftIndent = 100
word-document-api-examples/VB/CodeExamples/ListsActions.vb#L32
' Access the first list level.
Dim level As DevExpress.XtraRichEdit.API.Native.ListLevel = list.Levels(0)
' Specify the left indent of the level's paragraph.
See Also