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

Large image gets cut off in editor

3 Answers 183 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Bob asked on 01 May 2012, 03:50 PM
When I insert a large jpeg into the richtextbox, the editor chops off the right side of the image to fit into the richtextbox without a horizontal scrollbar.  What I need is a way to make the richtextbox expands to fit the image.

<
telerik:RadRichTextBox HorizontalAlignment="Stretch" LayoutMode="Flow" x:Name="editor" AllowDrop="True" Drop="editor_Drop" ShowComments="False"
                        BorderBrush="Transparent" BorderThickness="0" IsSelectionMiniToolBarEnabled="False"
                        IsContextMenuEnabled="True" IsInHeaderFooterEditMode="False" DocumentPresentationChanged="EditorDocumentContentChanged"
                        LostFocus="editor_LostFocus" SizeChanged="editor_SizeChanged" HorizontalScrollBarVisibility="Disabled">
</telerik:RadRichTextBox>

private void editor_SizeChanged(object sender, SizeChangedEventArgs e)
{
    this.editor.UpdateEditorLayout();
}

3 Answers, 1 is accepted

Sort by
0
Boby
Telerik team
answered on 04 May 2012, 08:43 AM
Hello Bob,
You just have to enable the horizontal scrollbar by removing
HorizontalScrollBarVisibility="Disabled"
from the RadRichTextBox in your XAML file.

Regards,
Boby
the Telerik team

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

0
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
answered on 04 May 2012, 08:17 PM
I did.  Please look at the code fragment I attached in the original post.
0
Ivailo Karamanolev
Telerik team
answered on 07 May 2012, 09:47 AM
Hi,

The issue you are seeing is due to the HorizontalAlignment="Stretch" property you have set. This causes the RadRichTextBox to stretch to fit the host container and will stop it from expanding. If you want it to expand, you have to use Left, Center or Right, depending on where you want your content aligned.
Let us know if you are able to fix the issue or need further assistance.

All the best,
Ivailo Karamanolev
the Telerik team

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

Tags
RichTextBox
Asked by
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Answers by
Boby
Telerik team
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Ivailo Karamanolev
Telerik team
Share this question
or