We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Numbered List

Thread ID:





75694 Aug 6,2008 03:31 PM UTC May 10,2010 12:07 PM UTC WinForms 6
Tags: DocIO
Hans Preuer
Asked On August 6, 2008 03:31 PM UTC


I'm evaluating DocIO and I have the following problem:

I will have a numbered list which looks like:

1 Header1
1.1 Header2
1.1.1 Header3
Standardtext ......

All numbers should beginn on left without indents and only 1 space between the numbers and the Headertext. And this numbering should be right for use in a Table of Content to a level of 3.

When I use paragraph.ListFormat.ApplyDefNumberedStyle() I get something like:
1 Header1
a. Header2
Standardtext ......

I've tried to make a new ParagraphStyle, but I can't remove the spaces between
1 Header1
and so on. How can I define a numbered liststyle which looks like my wanted style?

Thanks for any help.

Bhuvaneswari P [Syncfusion]
Replied On August 7, 2008 12:06 PM UTC

Hi Hans,

Thanks for evaluating Syncfusion products.

Yes, it is possible to create a number list like you given by using the FollowCharacter and TabSpaceAfter property of the Listlevel object. Please refer the below code snippet to do so:

Dim styleN As ListStyle = doc.AddListStyle(ListType.Numbered, "ListStyleN")
Dim listLevelL0 As WListLevel = styleN.Levels(0)
//Specify the type either Tab or Space
listLevelL0.FollowCharacter = FollowCharacterType.Space
listLevelL0.TabSpaceAfter = 1

Here is the sample which illustrates the above said feature:


Please try this sample and let us know if this helps you.

Best Regards,

Hans Preuer
Replied On August 7, 2008 03:04 PM UTC

Hi Bhuvana,

Thanks, now this works.


Bhuvaneswari P [Syncfusion]
Replied On August 11, 2008 12:37 PM UTC

Hi Hans,

Thanks for the update.


Boris Mouzo Izquierdo
Replied On May 5, 2010 02:43 PM UTC


I have a similar problem as the one who started this post but left unanswered. I'm generating a Word document with a numbered list. Let's say I need the following list:

1. Header1
1.1. Header1_1
1.1.1. Header1_1_1
1.1.2. Header1_1_2
1.2. Header1_2

As for now I've managed to get this:
1. Header1
1. Header1_1
1. Header1_1_1
2. Header1_1_2
2. Header1_2

What do I need to add or change to show on the indented headers the numbering of the parent header?

Thanks in advance

Boris Mouzo Izquierdo
Replied On May 6, 2010 07:12 AM UTC

Problem solved. After looking around a lot and googling through different pages I found the answer. I'll leave the link in case someone else has the same problem (search for deep level numbering instead of numbered list):

ListStyle styleN = document.AddListStyle(ListType.Numbered, "ListStyleN");
WListLevel listLevelL0 = styleN.Levels[0];
listLevelL0.CharacterFormat.FontSize = 16;
listLevelL0.CharacterFormat.Bold = true;
listLevelL0.CharacterFormat.Italic = true;
listLevelL0.ParagraphFormat.LeftIndent = 0;
listLevelL0.ParagraphFormat.FirstLineIndent = 20;
WListLevel listLevelL1 = styleN.Levels[1];
listLevelL1.IsLegalStyleNumbering = true;
//Numberprefix defines prefix before numbering.
//\x0000 - defines that numbering of the previous level will be inherited
listLevelL1.NumberPrefix = "\x0000.";
listLevelL1.ParagraphFormat.LeftIndent = 70;
listLevelL1.ParagraphFormat.FirstLineIndent = -10;
WListLevel listLevelL2 = styleN.Levels[2];
listLevelL2.IsLegalStyleNumbering = true;
//\x0000.\x0001. - inherirs numbering of level 0 and 1
listLevelL2.NumberPrefix = "\x0000.\x0001.";
listLevelL2.ParagraphFormat.LeftIndent = 130;
listLevelL2.ParagraphFormat.FirstLineIndent = -40;

Dim styleN As ListStyle = document.AddListStyle(ListType.Numbered, "ListStyleN")
Dim listLevelL0 As WListLevel = styleN.Levels(0)
listLevelL0.CharacterFormat.FontSize = 16
listLevelL0.CharacterFormat.Bold = True
listLevelL0.CharacterFormat.Italic = True
listLevelL0.ParagraphFormat.LeftIndent = 0
listLevelL0.ParagraphFormat.FirstLineIndent = 20
Dim listLevelL1 As WListLevel = styleN.Levels(1)
listLevelL1.IsLegalStyleNumbering = True
''Numberprefix defines prefix before numbering.
''\x0000 - defines that numbering of the previous level will be inherited
listLevelL1.NumberPrefix = ChrW(&H0000).ToString() & "."
listLevelL1.ParagraphFormat.LeftIndent = 70
listLevelL1.ParagraphFormat.FirstLineIndent = -10
Dim listLevelL2 As WListLevel = styleN.Levels(2)
listLevelL2.IsLegalStyleNumbering = True
''\x0000.\x0001. - inherirs numbering of level 0 and 1
listLevelL2.NumberPrefix = ChrW(&H0000).ToString() & "." & ChrW(&H0001).ToString() & "."
listLevelL2.ParagraphFormat.LeftIndent = 130
listLevelL2.ParagraphFormat.FirstLineIndent = -40

Poornima R [Syncfusion]
Replied On May 10, 2010 12:07 PM UTC

Hi Boris,

Thank you for your update.

We are glad that you have found the solution by yourself.

Please let us know if you have any other further queries.



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon