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

Duplication problem with InlineUIContainer

4 Answers 70 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Calin Calin
Top achievements
Rank 1
Calin Calin asked on 01 Mar 2011, 10:38 AM
Hi,

I use the above code to insert a TextBlock in the richtextbox control
var textBlock = new TextBlock
            {
                Text = " [" + item.Name + "] ",
                TextAlignment = TextAlignment.Center,
                Foreground = new SolidColorBrush(Color.FromArgb(0xff0xff0x000x00)),
            };
 
            InlineUIContainer inlineUiContainer = new InlineUIContainer(textBlocknew Size(1010));
            
            rrtb.InsertInline(inlineUiContainer);
            rrtb.Focus();

The problem is that the when I export in xaml it inserts a texblock and a run. When I import the file back in I get the text duplicated.

Any ideas ?

Thanks,

4 Answers, 1 is accepted

Sort by
0
Iva Toteva
Telerik team
answered on 04 Mar 2011, 11:21 AM
Hi Calin Calin,

Thank you for bringing this issue to our attention. The problem is that with text blocks, the text is kept in two places - in the Text property and in the Inlines collection (as a Run in your case). The serializer we use serializes both properties and on import the text gets duplicated.
Most probably we will revise the way XamlFormatProvider works and hopefully, we will manage to provide the means that will enable your scenario in the upcoming Q1.

Greetings,
Iva
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
Adrian
Top achievements
Rank 1
answered on 17 May 2011, 07:55 PM
Hi,

I've ran into the same problem. Do you have any updates regarding this problem?

Thank you.
0
Iva Toteva
Telerik team
answered on 20 May 2011, 12:32 PM
Hi Adrian,

We have not fixed this problem yet and I cannot provide you with a specific timeline of when it would be fixed, as it has not been scheduled for revision yet. We have quite a few features and issues of higher priority on the to-do list for Q2 and we have our hands pretty much full.
However, as documents exported to XAML are valid XML, you can open them using XDocument and clear the value of the Inlines property or the Text. Then on load in the rich text box the text will not be duplicated.
I hope this helps.

Regards,
Iva
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
0
Adrian
Top achievements
Rank 1
answered on 20 May 2011, 12:35 PM
Hi Iva,

Thanks for your reponse. Already did this and it surely works.
Can't wait to see what you put in the Q2 release.
Tags
RichTextBox
Asked by
Calin Calin
Top achievements
Rank 1
Answers by
Iva Toteva
Telerik team
Adrian
Top achievements
Rank 1
Share this question
or