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

HTML Email viewer

1 Answer 284 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Marcel
Top achievements
Rank 1
Marcel asked on 20 Aug 2016, 01:24 PM

Hello,

I am trying to create a email message viewer like Outlook using the RichTextbox.

Is this the right control to use for this scenario?

The viewer should be able to display plain-text emails and HTML emails.

 

I implemented it partially but I cant get the scrollbar visiblewhen the message is longer then what can be contained in the richtextbox.

<ContentControl Grid.Row="6" Grid.Column="0" Grid.ColumnSpan="3">
    <Grid>
        <telerikHtml:HtmlDataProvider Html="{Binding BodyText, Mode=TwoWay}"
                                        RichTextBox="{Binding ElementName=rtbHtmlEmail}" x:Name="htmlDataProvider" />
        <ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
            <telerik:RadRichTextBox x:Name="rtbHtmlEmail" Padding="15"
                                    MinWidth="800" MinHeight="650"
                                    HorizontalAlignment="Stretch"
                                    VerticalAlignment="Stretch"
                                    HorizontalContentAlignment="Left"
                                    VerticalContentAlignment="Top"
                                    IsReadOnly="True"
                                    LayoutMode="Flow"/>
        </ScrollViewer>
    </Grid>
</ContentControl>
    

1 Answer, 1 is accepted

Sort by
0
Tanya
Telerik team
answered on 24 Aug 2016, 03:08 PM
Hi Marcel,

RadRichTextBox is intended exactly for showing/modifying flow documents from different file formats and I believe it could fit your scenario.

The ScrollViewer measures its children with Infinity, thus, the RadRichTextBox instance doesn't receive a particular size in which it should fit. This leads to stretching the control, the document receives enough space to load its whole content and the scroll bars aren't activated. If you change the container you are using to a different one that sets a size to its children (for example, Grid), you should be able to use the scrolling of the control.

In addition, we usually advise against measuring RadRichTextBox in Infinity as this will disable the UI Virtualization of the control and could lead to performance diminishments or unexpected behavior.

In regards to the export functionalities, you could refer to our Import/Export section that describes the supported in RadRichTextBox formats and how to use them.

Hope this helps.

Regards,
Tanya
Telerik by Progress
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Tags
RichTextBox
Asked by
Marcel
Top achievements
Rank 1
Answers by
Tanya
Telerik team
Share this question
or