Characters and words wrapping arbitrarily in RichTextBox used for print preview

4 posts, 1 answers
  1. Alex
    Alex avatar
    8 posts
    Member since:
    Nov 2011

    Posted 29 Oct 2013 Link to this post

    Hello,

    I am using the RichTextBox as a print preview in combination with manually building up an associated RadDocument in code behind.

    We recently upgraded to Q3 2013 (version 2013.3.1016) and now I am seeing some really strange behavior with text wrapping. No matter how much room is made available, the text will behave the same. However, changing font properties seems to have some impact on where the break occurs.

    I have read the release notes and realize that there were changes to working with RadDocument directly. However, I have tried using the APIs on both the DocumentEditor and the RadRichTextBox and the breaks still appear to occur.

    Is anyone able to shed any light on why this may have started happening?


  2. Answer
    Petya
    Admin
    Petya avatar
    975 posts

    Posted 31 Oct 2013 Link to this post

    Hello,

    I am having a hard time determining the cause of the issue based on the snapshot you attached. Could you please open a support ticket and send us a project which demonstrates your setup as well as how you are creating and modifying documents?

    I'm looking forward to hearing from you.

    Regards,
    Petya
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. DevCraft banner
  4. Alex
    Alex avatar
    8 posts
    Member since:
    Nov 2011

    Posted 03 Nov 2013 Link to this post

    Hi Petya.

    Thanks for the response. Since I posted this, I have discovered that the issue was that in our application, someone overrode the default template for TextBlock with...

    <Style TargetType="TextBlock" x:Key="DefaultTextBlockStyle">
        <Setter Property="Padding" Value="0" />
        <Setter Property="Margin" Value="0" />
        <Setter Property="VerticalAlignment" Value="Center" />
        <Setter Property="TextWrapping" Value="Wrap" />
    </Style>
     
    <Style TargetType="TextBlock" BasedOn="{StaticResource DefaultTextBlockStyle}" />

    When I remove the application of this style, the RadRichTextBox behaves as before.

    I'm still not certain how this was not manifesting as a problem in the previous version, but at least have found the culprit.

    Regards
    Alex
  5. Petya
    Admin
    Petya avatar
    975 posts

    Posted 05 Nov 2013 Link to this post

    Hello Alex,

    Thank you for the follow-up!

    TextBlocks are used internally by RadRichTextBox for visualizing content so the style you mentioned might cause the behavior you are observing.  If the particular style is needed in your application you can try resetting the default style for TextBlock in the scope of the RadRichTextBox in your application.

    I hope this helps! Let us know if you have any other comments or questions.

    Regards,
    Petya
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
Back to Top