HTML Email viewer

2 posts, 0 answers
  1. Marcel
    Marcel avatar
    40 posts
    Member since:
    Jan 2014

    Posted 20 Aug Link to this post

    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>
        

  2. Tanya
    Admin
    Tanya avatar
    404 posts

    Posted 24 Aug Link to this post

    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.
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top