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.
Unfortunately, activation email could not send to your email. Please try again.

Add bulleted list to a paragraph programatically

Thread ID:

Created:

Updated:

Platform:

Replies:

119610 Jul 14,2015 07:18 AM Jul 17,2015 11:42 AM WPF 6
loading
Tags: SfRichTextBoxAdv
Shaun Verduyn
Asked On July 14, 2015 07:18 AM

I have checked the online documentation but the documentation is for the old RichTextBoxAdv control and not for the new version 13.2 SfRichTextBoxAdv control.
Could you please, if possible, give me an example of hot to programtically add a bulleted/numbered list to a paragraph.

Thank you,

Shaun Verduyn

Arumuga Perumal S [Syncfusion]
Replied On July 15, 2015 01:42 AM

Hi Shaun,

Thank you for your interest in Syncfusion products.

Our RichTextBoxAdv control supports both simple list and multilevel list. We have mentioned below the sample code snippet to illustrate how to add a list to the RichTextBoxAdv document and how to apply the list to the paragraph.

Sample Code:

[C#]


// Initializes a new abstract list instance.

AbstractListAdv abstractListAdv = new AbstractListAdv(null);

abstractListAdv.AbstractListId = 1;

// Creates a new list instance.

ListAdv listAdv = new ListAdv(null);

listAdv.AbstractList = abstractListAdv;

listAdv.AbstractListId = abstractListAdv.AbstractListId;

listAdv.ListId = 1;

// Defines new ListLevel instance.

ListLevelAdv listLevel = new ListLevelAdv(abstractListAdv);

listLevel.ParagraphFormat.LeftIndent = 48d;

listLevel.ParagraphFormat.FirstLineIndent = 24d;

listLevel.FollowCharacter = FollowCharacterType.Tab;

listLevel.ListLevelPattern = ListLevelPattern.LowLetter;

listLevel.NumberFormat = "(%1.)";

listLevel.RestartLevel = 0;

listLevel.StartAt = 1;

// Adds list level to abstract list.

abstractListAdv.Levels.Add(listLevel);


// Adds abstract list to the document.

richTextBoxAdv.Document.AbstractLists.Add(abstractListAdv);

// Adds list to the document.

richTextBoxAdv.Document.Lists.Add(listAdv);

// Defines list format for a paragraph.

paragraph.ParagraphFormat.ListFormat.ListId = listAdv.ListId;

paragraph.ParagraphFormat.ListFormat.ListLevelNumber = 0;



We have also prepared a sample to demonstrate the same. Please do find the sample from below link. Try running the sample and let us know if this helps you.

Sample link:
Sample

Please let us know if you have any other questions.

Regards,
Arumuga Perumal S.


Shaun Verduyn
Replied On July 15, 2015 06:34 AM

Hi Arumuga,

Awesome, thank you very much for the sample, the great support and the great controls. I tested the sample and it works great!
Will see if I can implement it correctly in my project.

Thank you,

Shaun


Shaun Verduyn
Replied On July 15, 2015 08:42 AM

Hi Arumuga,

I have managed to get it working, but I can't seem to get the following right :-

Wall Type Information
1.  The following types of masonry walling comply with the R-value requirements:
     a.  Double-skin masonry with no cavity, plastered internally, or rendered externally; or NOTE The cavity and grouted cavity walling systems exceed the minimum R-value of 0.35
     b.  Single-leaf masonry walls with a nominal wall thickness greater than or equal to 140 mm (excluding plastering and rendering), plastered internally and rendered externally. The requirements refer to the external walls of the habitable portions of
          the building fabric only
2.  For masonry walling types not covered in 4.4.3.2, such walls shall achieve a minimum total R-value of 0.35. The total R-value shall be determined by means of a test conducted in accordance with ASTM C 1363, ASTM C 518 or ASTM C 177. Surface
     film resistance shall be in accordance with SANS 6946.

Could you please show me how to do this.

Thank you,

Shaun

Arumuga Perumal S [Syncfusion]
Replied On July 16, 2015 01:30 AM

Hi Shaun,

Thank you for your update.

We have prepared a sample to illustrate how to create multilevel list in SfRichTextBoxAdv control programmatically as per your requirement. Please do find the sample from below link. Try running the sample and let us know if this helps you.

Sample link:
MultiLevelListSample

Please let us know if you have any other questions.

Regards,
Arumuga Perumal S.


Shaun Verduyn
Replied On July 16, 2015 04:13 AM

Hi Arumuga,

The sample is great, actually a life saver. I was tearing my hear out and managed to get it part way there, what got me was the setting up of the abstract levels.
Feel a bit stupid now that I see how simple it actually is.

Thank you very much, it is most appreciated!!

Thanks,

Shaun

Sathish K [Syncfusion]
Replied On July 17, 2015 11:42 AM

Hi Shaun,

Thank you for your valuable feedback. It is our pleasure to know that the provided sample has resolved your issue. Please let us know if you need further assistance. We will be happy to assist you as always.

Regards,
Sathish


CONFIRMATION

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.

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.

;