Can BulletCheckmark be used in second level bullet list?

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:

TwoLevels

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

Hi,

Try using this:

bulletList.ListLevelFormats[1].NumberFormat = "\uF0B7";
bulletList.ListLevelFormats[1].CharacterFormat.FontName = "Symbol";

checkmarkList.ListLevelFormats[1].NumberFormat = "\uF0B7";
checkmarkList.ListLevelFormats[1].CharacterFormat.FontName = "Symbol";

Does this solve your issue?

Regards,
Mario

Thanks, Mario, now the white circle is black, but the checkmark is not shown:

TwoLevels-2

            ListStyle bulletList = new ListStyle(ListTemplateType.Bullet);
            bulletList.ListLevelFormats[0].ParagraphFormat.NoSpaceBetweenParagraphsOfSameStyle = true;
            bulletList.ListLevelFormats[1].ParagraphFormat.NoSpaceBetweenParagraphsOfSameStyle = true;
            bulletList.ListLevelFormats[1].NumberFormat = "\uF0B7";
            bulletList.ListLevelFormats[1].CharacterFormat.FontName = "Symbol";

            ListStyle checkmarkList = new ListStyle(ListTemplateType.BulletCheckmark);
            checkmarkList.ListLevelFormats[0].ParagraphFormat.NoSpaceBetweenParagraphsOfSameStyle = true;
            checkmarkList.ListLevelFormats[1].ParagraphFormat.NoSpaceBetweenParagraphsOfSameStyle = true;
            checkmarkList.ListLevelFormats[1].NumberFormat = "\uF0B7";
            checkmarkList.ListLevelFormats[1].CharacterFormat.FontName = "Symbol";

I see now, try this:

checkmarkList.ListLevelFormats[1].NumberFormat = "\uF0FC";
checkmarkList.ListLevelFormats[1].CharacterFormat.FontName = "Wingdings";

Regards,
Mario

1 Like

Awesome, thanks Mario!!!
It is working now!
Best, Thomas

TwoLevels-3