Skip to main content
A newer version of this page is available. .
.NET Framework 4.5.2+

AbstractNumberingListCollection.Add() Method

Creates a new AbstractNumberingList object and adds it to the collection.

Namespace: DevExpress.XtraRichEdit.API.Native

Assembly: DevExpress.RichEdit.v19.1.Core.dll

Declaration

AbstractNumberingList Add()

Returns

Type Description
AbstractNumberingList

An AbstractNumberingList interface specifying base list format options.

Remarks

Use the Add method to create a pattern for bulleted, numbered or multilevel list. The NumberingListBase.NumberingType property define the list type.

The NumberingListBase.Levels obtains list levels. A list has 9 levels regardless of its type. Use ListLevel.ParagraphProperties and ListLevel.CharacterProperties properties to access list marker’s 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();
See Also