Is there any reason when executing either of the following two commands I should get the following error?
Command Executing:
//Loop Through Document Sections
foreach
(Section sectionLayoutBox
in
radRichTextBox.Document.Children)
{
//Loop Through Section Paragraphs
foreach
(Paragraph paragraph
in
sectionLayoutBox.EnumerateChildrenOfType<Paragraph>().ToList<Paragraph>())
{
//Remove Paragraph From Document
//paragraph.Parent.Children.Remove(paragraph);
sectionLayoutBox.Children.Remove(paragraph);
}
}
Error Message: inline does not belong to this document.
I know my initial post is a little vague, I can elaborate in more detail if you require.
Thanks,
Rob