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

Displaying Images using HTML Support

1 Answer 94 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
MobiusStrip
Top achievements
Rank 1
MobiusStrip asked on 31 Mar 2011, 05:55 PM
I have a database table that holds a series of records in HTML format.  (These are built on an on-going basis by actions taken by the user).  They are then reported in a "History Report".. a sample of a few rows might be....

Condition # 1100 ___<br />
<b>B. D. Smith</b><br />
etc...

Now, B.D. Smith is a person whose picture I would like to display ...in old-fashioned HTML I would just change the row to something like

<b><img src='foo.png'>B. D. Smith</img></b><br />

Which does not seem to work in my RadRichTextBox. I assume this is because the <img> tag is not supported as part of your HTML support.  When I try this an simply put 'foo.png' in the ClientBin folder, it displays as a blank character on my "History Report".

Note:  The reason I'm putting the image in ClientBin is that I want the image to be available from a url, not from inside the xap file.  If I can get this to work in ClientBin, then I can change my HTML to get the image from a common repository.  I just thought that ClientBin would be the simplest case for my initial tests.  

I'm using the control like this in the XAML:

        <telerik:RadRichTextBox x:Name="ReportPage" IsReadOnly="true" Background="White"  
IsSpellCheckingEnabled="False"  Width="940" >
         </telerik:RadRichTextBox>


I build the HTML string and then do the binding... in the .VB file

                Me.ReportPage.DataContext = _weeklyReports(_weekNumber)
                ReportPage.Document = ImportHTML(_weeklyReports(_weekNumber))

(This is a conversion from an old desktop program...most of my old html formatting works, or I have been able to make it work by using the HTML tags provided in 

http://www.telerik.com/help/silverlight/radrichtextbox-features-html-support.html

Can you give me a solution for displaying an image,  a starting point or a wag of the finger telling me I'm totally off base on my approach?  Thank you.
  

1 Answer, 1 is accepted

Sort by
0
MobiusStrip
Top achievements
Rank 1
answered on 31 Mar 2011, 06:12 PM
Hmm. I don't see a way to delete the post.  

I tried <img src='http://fissure001.simulationpoweredlearning.com/Client/ClientBin/test.png'>...

and that works!  So, apparently I'm ok using <img> tags.  I just have to be careful where I put them and how I access them.


Tags
RichTextBox
Asked by
MobiusStrip
Top achievements
Rank 1
Answers by
MobiusStrip
Top achievements
Rank 1
Share this question
or