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

Characters and words wrapping arbitrarily in RichTextBox used for print preview

3 Answers 56 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Alex
Top achievements
Rank 1
Alex asked on 30 Oct 2013, 12:48 AM
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?


3 Answers, 1 is accepted

Sort by
0
Accepted
Petya
Telerik team
answered on 31 Oct 2013, 04:12 PM
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 >>
0
Alex
Top achievements
Rank 1
answered on 04 Nov 2013, 01:57 AM
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
0
Petya
Telerik team
answered on 05 Nov 2013, 05:18 PM
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 >>
Tags
RichTextBox
Asked by
Alex
Top achievements
Rank 1
Answers by
Petya
Telerik team
Alex
Top achievements
Rank 1
Share this question
or