This is a migrated thread and some comments may be shown as answers.

How to remove Paragraph from section?

1 Answer 161 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Alexander
Top achievements
Rank 1
Alexander asked on 23 Jun 2011, 09:03 PM
Hi, guys.
I have a problem: I'm getting NullReferenceException when trying to remove Paragraph from it's parent Section.
If I'm trying to remove all inner Spans of that Paragraph - I'm also getting a NullReferenceException. What's wrong with that?

Thanks in advance.

1 Answer, 1 is accepted

Sort by
0
Alex
Telerik team
answered on 29 Jun 2011, 01:10 PM
Hi Alexander,

Unfortunately , we were unable to reproduce the exception. Here is what we've tried:

string txt = @"one
two two
three three three";
RadDocument doc = new TxtFormatProvider().Import(txt);

Paragraph par = (Paragraph)doc.Sections.First.Blocks.First;
par.Inlines.Remove(par.Inlines.First);
doc.Sections.First.Blocks.Remove(par);

We would greatly appreciate if you send us a sample project that shows the problem so we could further investigate it. All the best,
Alex
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
RichTextBox
Asked by
Alexander
Top achievements
Rank 1
Answers by
Alex
Telerik team
Share this question
or