Dear GemBox team,
is it possible to change the style of the second level in a bullet list?
I was only able to use e.g. a BulletCheckmark on the first level.
The second level always uses a white circle:
I would like to use different styles in the second level depending on the meaning of each item, e.g. a completed task should get a checkmark, an open task a white circle, and other items a black circle.
Best, Thomas
ComponentInfo.SetLicense("FREE-LIMITED-KEY");
var document = new DocumentModel();
var section = new Section(document);
document.Sections.Add(section);
var blocks = section.Blocks;
// Create bullet list style.
ListStyle bulletList = new ListStyle(ListTemplateType.Bullet);
bulletList.ListLevelFormats[0].ParagraphFormat.NoSpaceBetweenParagraphsOfSameStyle = true;
bulletList.ListLevelFormats[1].ParagraphFormat.NoSpaceBetweenParagraphsOfSameStyle = true;
ListStyle checkmarkList = new ListStyle(ListTemplateType.BulletCheckmark);
checkmarkList.ListLevelFormats[0].ParagraphFormat.NoSpaceBetweenParagraphsOfSameStyle = true;
checkmarkList.ListLevelFormats[1].ParagraphFormat.NoSpaceBetweenParagraphsOfSameStyle = true;
// Create bullet list items.
blocks.Add(new Paragraph(document, "Item 1")
{
ListFormat = { Style = bulletList }
});
blocks.Add(new Paragraph(document, "Item 2")
{
ListFormat = { Style = checkmarkList }
});
blocks.Add(new Paragraph(document, "Item 2.1")
{
ListFormat = { Style = bulletList, ListLevelNumber = 1 }
});
blocks.Add(new Paragraph(document, "Item 2.2")
{
ListFormat = { Style = checkmarkList, ListLevelNumber = 1 }
});
blocks.Add(new Paragraph(document));
document.Save("TwoLevels.docx");