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

Wrapping RTF text in a RadRichTextBox

1 Answer 175 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
juanjo
Top achievements
Rank 1
juanjo asked on 30 Jan 2012, 10:47 AM

In the following piece of code I'm loading some RTF text into a telerik RadRichTextBox. Does anyone know how to set the text control to wrap the text to the box width? Take into account that the sample code is part of a DataTemplate in the resources section of a window, therefore variable _reportRTFBox is not available in window code behind

<Grid>
<Grid.RowDefinitions>
    <RowDefinition/>
    <RowDefinition />
</Grid.RowDefinitions>
<telerikProvider:RtfDataProvider
    Grid.Row="1"
    Rtf="{Binding ReportToDistributeRTF}"
    RichTextBox="{Binding ElementName=_reportRTFBox}" />
<telerik:RadRichTextBox
    Grid.Row="0"
    x:Name="_reportRTFBox"
    MaxHeight="200"
    ScrollViewer.VerticalScrollBarVisibility="Auto"
    ScrollViewer.HorizontalScrollBarVisibility="Auto"
    IsReadOnly="True"/>

Many thanks,

Juanjo

1 Answer, 1 is accepted

Sort by
0
Boby
Telerik team
answered on 02 Feb 2012, 08:29 AM
Hi Juanjo,
RadRichTextBox wraps text to its width when put in Flow layout mode.You can remove scrollbar visibility setters from the data template.

All the best,
Boby
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
RichTextBox
Asked by
juanjo
Top achievements
Rank 1
Answers by
Boby
Telerik team
Share this question
or