Hi, how can I get the paragraphs from a RadDocument? (I'd like to remove the last empty lines/enters/paragraphs from the text..)
Thanks,
Tamas
3 Answers, 1 is accepted
0
Ivailo Karamanolev
Telerik team
answered on 30 Nov 2010, 04:42 PM
Hi Kirmer,
In Q3 we have introduced a method in every DocumentElement (RadDocument, including, being DocumentElement itself) called EnumerateChildrenOfType<T>() which recursively traverses all child elements of type T. You can foreach through all paragraphs like this:
Thanks for the answer, it works. And how can I delete the actual paragraph inside the foreach?
Thanks and regards,
Tamas
0
Iva Toteva
Telerik team
answered on 02 Dec 2010, 09:14 AM
Hi Kirmer,
Since you cannot remove the elements of a collection in a foreach cycle, you would need to find which elements you want to delete at one pass and actually delete them afterwards. Something like: