Duplication problem with InlineUIContainer

5 posts, 0 answers
  1. Calin Calin
    Calin Calin avatar
    59 posts
    Member since:
    Mar 2010

    Posted 01 Mar 2011 Link to this post

    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,
  2. Iva Toteva
    Admin
    Iva Toteva avatar
    1319 posts

    Posted 04 Mar 2011 Link to this post

    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!
  3. Adrian
    Adrian avatar
    2 posts
    Member since:
    Jul 2010

    Posted 17 May 2011 Link to this post

    Hi,

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

    Thank you.
  4. Iva Toteva
    Admin
    Iva Toteva avatar
    1319 posts

    Posted 20 May 2011 Link to this post

    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
  5. Adrian
    Adrian avatar
    2 posts
    Member since:
    Jul 2010

    Posted 20 May 2011 Link to this post

    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.
Back to Top