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

Add ImageInline to RadDocument element?

1 Answer 30 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Lindsay Miles
Top achievements
Rank 1
Lindsay Miles asked on 11 Nov 2013, 02:55 AM
Hello,

I'm having some trouble adding an image to a RadDocument and am obviously doing something wrong.
ImageInline teamLogo = new ImageInline( isoDir.OpenFile("TeamLogo.png", FileMode.Open));
Paragraph teamlogoParagraph = new Paragraph();
teamlogoParagraph.Inlines.Add(teamLogo);
teamLogoCell.Children.Add(teamlogoParagraph);

When I get to this:

popupWindow.radRichTextBox.Document.UpdateLayout() //error on this line
popupWindow.Show();

I get this error: Unable to cast object of type 'Telerik.Windows.Documents.Model.ImageInline' to type 'Telerik.Windows.Documents.Model.Block'.

Any advice on this? Hierarchy is correct and I followed samples in the documentation...

I HAVE TO use the ImageInline as later on I get an ImageInline object derived from the contents of a canvas control which needs to also go into the RadDocument as an image. I assume solving the former case will help later with the latter...

Please advise!

Thanks

 

 

 

 

1 Answer, 1 is accepted

Sort by
0
Svetoslav
Telerik team
answered on 13 Nov 2013, 12:05 PM
Hello Lindsay,

Thank you for contacting us!

We have not experienced such an issue and my attempts to replicate the issue you describe were not successful.
The best way to approach such a problem is to replicate this behavior on our side and analyze its roots. For this reason I kindly ask you to send us your solution. In order to attach files other than images you'd have to open a support ticket. Once we are able to reproduce the error, we will do our best to assist you.

Looking forward to hearing from you.

Regards,
Svetoslav
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
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
Lindsay Miles
Top achievements
Rank 1
Answers by
Svetoslav
Telerik team
Share this question
or