Using RadRichTextBox to display and input text, tables, images, and files

6 posts, 0 answers
  1. David
    David avatar
    4 posts
    Member since:
    Oct 2011

    Posted 18 Nov 2011 Link to this post

    I am using the RadRichTextBox to input and display various types of data. So far text input works fine. However when I copy and paste an image it seems to appear in the RadRichTextBox but the actual image is invisible. I would like to have text, tables, images and files if possible inside my RadRichTextBox. Here's some code that I've tried thus far. As I understand it XamlDataProvider takes a string in xaml format as its data source. Which is fine but then I don't understand how binary files like images are handled. A code sample in the mvvm pattern would be great. Thank you.
    <StackPanel>
        <telerikXaml:XamlDataProvider RichTextBox="{Binding ElementName=radRich}" Xaml="{Binding Path=XamlText, Mode=TwoWay}"></telerikXaml:XamlDataProvider>
        <telerik:RadRichTextBox x:Name="radRich" />
    </StackPanel>

    private string xamlText;
    public string XamlText
    {
        get { return xamlText; }
        set
        {
            if (xamlText != value)
            {
                xamlText = value;
                RaisePropertyChanged("XamlText");
            }
        }
    }

  2. Iva Toteva
    Admin
    Iva Toteva avatar
    1319 posts

    Posted 23 Nov 2011 Link to this post

    Hi David,

    Please find attached a demo illustrating the binding of RadRichTextBox's document with XamlDataProvider. I have also included the result of the XAML export of a document, which includes tables, images, etc. as a constant in the ViewModel. This document is loaded when you start the application.
    I hope this helps.

    Regards,
    Iva Toteva
    the Telerik team

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

  3. UI for WPF is Visual Studio 2017 Ready
  4. Fabio
    Fabio avatar
    7 posts
    Member since:
    Jul 2010

    Posted 16 Apr 2012 Link to this post

    Is it possible to include files in RichTextBox as attachments? The output could be a pdf files with attachments.
    Thanks
  5. Iva Toteva
    Admin
    Iva Toteva avatar
    1319 posts

    Posted 18 Apr 2012 Link to this post

    Hello Fabio,

    It is not possible to add file attachments to RadDocument or RadRichTextBox.

    This feature is currently not scheduled for implementation, so I cannot provide you with any details if or when it will be implemented.

    All the best,
    Iva Toteva
    the Telerik team

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

  6. Jaypee
    Jaypee avatar
    13 posts
    Member since:
    Jun 2013

    Posted 22 Jul 2013 Link to this post

    can I also perform Find and Replace using the xamlText?
  7. Petya
    Admin
    Petya avatar
    975 posts

    Posted 25 Jul 2013 Link to this post

    Hi Jaypee,

    I am afraid I am a bit confused about what exactly you are trying to achieve. Would you mind elaborating on the requirements you wish to fulfill with RadRichTextBox's Find and Replace functionality?

    Looking forward to your reply.

    Regards,
    Petya
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    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 >>
Back to Top
UI for WPF is Visual Studio 2017 Ready