Hi there
Could anyone please tell me how can I enable my RichTextBoxRibbonUI to insert an image using an absolute URL as the source.
Instead of the OpenFileDialog, I want to type http://www.host.com/images/image.jpg
I saw this post here:
http://www.telerik.com/community/forums/silverlight/richtextbox/inserting-an-image-in-the-radrichtextbox.aspx
But sitll have no idea how to implement it, on both xaml and .cs sides.
Thanks
Emerson de Mello
Could anyone please tell me how can I enable my RichTextBoxRibbonUI to insert an image using an absolute URL as the source.
Instead of the OpenFileDialog, I want to type http://www.host.com/images/image.jpg
I saw this post here:
http://www.telerik.com/community/forums/silverlight/richtextbox/inserting-an-image-in-the-radrichtextbox.aspx
But sitll have no idea how to implement it, on both xaml and .cs sides.
Thanks
Emerson de Mello
5 Answers, 1 is accepted
0
Hi Emerson,
where url is the Uri of the image you want to insert, e.g.:
Kind regards,
Iva Toteva
the Telerik team
You can insert an image from a URL in the following way:
this
.editor.InsertInline(
new
ImageInline(url));
Uri url =
new
Uri(
"http://www.telerik.com/CSS/Global/telerik-logo.png"
);
Iva Toteva
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0

Emerson
Top achievements
Rank 1
answered on 22 Nov 2011, 10:55 AM
Thanks for your reply.
What command behaviour should I insert this code?
How can I ensure when I press the Insert Image from the RichTextBoxRibbonUI, the command does not show the OpenFileDialog box and then access the code behind opening another dialog asking the user to type in the image URL?
What command behaviour should I insert this code?
How can I ensure when I press the Insert Image from the RichTextBoxRibbonUI, the command does not show the OpenFileDialog box and then access the code behind opening another dialog asking the user to type in the image URL?
0
Hi Emerson,
You could remove the button's default binding code:
and bind the button's Command property to your custom command (or use an event handler) showing your custom dialog and performing the above mentioned logic.
Boby
the Telerik team
You could remove the button's default binding code:
telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=InsertPictureCommand}"
Don't hesitate to contact us if you have other questions.
Kind regards,Boby
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0

Mohamed
Top achievements
Rank 1
answered on 21 Dec 2011, 04:58 PM
Hi Boby,
I followed the above and image does not display correctly.
My RichTextBox control is an email editor. I am trying to send the html output as an email from the wpf application. I am using HtmlDataProvider. If I use inline image, the image is not displaying in the email client as well even after trying with various browsers.
The snapshot is attached.
I followed the above and image does not display correctly.
private void RadRibbonButton_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
{
var url = new Uri("http://www.telerik.com/CSS/Global/telerik-logo.png");
this.editor.InsertInline(new ImageInline(url));
}
My RichTextBox control is an email editor. I am trying to send the html output as an email from the wpf application. I am using HtmlDataProvider. If I use inline image, the image is not displaying in the email client as well even after trying with various browsers.
The snapshot is attached.
0
Hi Mohamed,
Iva Toteva
the Telerik team
Most of the email clients blocks inline images which are included in the HTML document with their raw data.
You could customize the export of images of HtmlFormatProvider by setting the ImageExportMode and eventually handling ImageExportingEvent of HtmlExportSettings class (as described in this article).
Iva Toteva
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>