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

Loading images from relative urls and link clicks.

3 Answers 119 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Jakkie Esschert van den
Top achievements
Rank 1
Jakkie Esschert van den asked on 19 Nov 2010, 11:28 AM
Hi,

I'm using the RadRichTextBox to display pages loaded from my webserver (to display help texts). I manually fetch the html and import that into the Document of the textbox. When te html page contains images those are only displayed when their url is absolute, not when the are relative. Is there any way to make relative urls work properly?

And there is another annoyance, to follow links a Ctrl click is needed, even when the textbox is readonly, and I can't find a way do disable that.

3 Answers, 1 is accepted

Sort by
0
Ivailo Karamanolev
Telerik team
answered on 22 Nov 2010, 04:58 PM
Hi Jakkie Esschert van den,

As for the loading of images, HtmlFormatProvider contains a Settings property, of type HtmlImportSettings. You can have a look at the various customization options available there. The one you need in this case is LoadImageFromUrl event which you can handle and provide custom logic for resolving images, referencing relative URLs as needed.
Unfortunately, there is no single property to disable link follow, however you can easily handle the HyperlinkClicked event of the RadRichTextBox or RadDocument and simply set the e.Handled = true property which will suppress the default behavior of opening the page. Another option would be to walk all the Hyperlinks after import and simply nullify all URLs, which will render the Hyperlinks as plain text.

Regards,
Ivailo
the Telerik team
Browse the videos here>> to help you get started with RadControls for Silverlight
0
Zero Gravity Chimp
Top achievements
Rank 2
answered on 02 Dec 2010, 06:07 AM
Hi Ivailo

I don't think the issue is really addressed here regarding Ctrl+click.

In microsoft word, we need to ctrl+click hyperlinks because you may want to edit the text. In Internet explorer, a hyperlink does not require ctrl+click.

So my suggestion is that when the RadRichTextBox isReadOnly="false", it is fine to ctrl+click hyperlinks incase you were editing that text. BUT when not in Read Only mode, we should be able to simply click the hyperlink directly.

There is no reason why a simple click should not click the link when not in edit mode.

Is this bug going to be addressed?

Regards

Paul
0
Iva Toteva
Telerik team
answered on 02 Dec 2010, 10:35 AM
Hi Paul,

Thank you for your suggestion. We have revised this feature and will be enabling the following of links on Click and not Ctrl+Click when in ReadOnly mode.
Until this is implemented and available you can see how you can mimic this behavior in this forum post.
If you have other questions, do not hesitate to contact us again.

Best wishes,
Iva
the Telerik team
Browse the videos here>> to help you get started with RadControls for Silverlight
Tags
RichTextBox
Asked by
Jakkie Esschert van den
Top achievements
Rank 1
Answers by
Ivailo Karamanolev
Telerik team
Zero Gravity Chimp
Top achievements
Rank 2
Iva Toteva
Telerik team
Share this question
or