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

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

5 Answers 151 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 18 Nov 2011, 06:07 AM
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");
        }
    }
}

5 Answers, 1 is accepted

Sort by
0
Iva Toteva
Telerik team
answered on 23 Nov 2011, 01:45 PM
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 >>

0
Fabio
Top achievements
Rank 1
answered on 16 Apr 2012, 05:07 PM
Is it possible to include files in RichTextBox as attachments? The output could be a pdf files with attachments.
Thanks
0
Iva Toteva
Telerik team
answered on 18 Apr 2012, 02:23 PM
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 >>

0
Jaypee
Top achievements
Rank 1
answered on 23 Jul 2013, 04:26 AM
can I also perform Find and Replace using the xamlText?
0
Petya
Telerik team
answered on 25 Jul 2013, 04:02 PM
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 >>
Tags
RichTextBox
Asked by
David
Top achievements
Rank 1
Answers by
Iva Toteva
Telerik team
Fabio
Top achievements
Rank 1
Jaypee
Top achievements
Rank 1
Petya
Telerik team
Share this question
or