RichText, html, import export

2 posts, 0 answers
  1. Kyle Watson
    Kyle Watson avatar
    19 posts
    Member since:
    May 2010

    Posted 30 Jan 2011 Link to this post

    Greetings,

    First, I just upgraded my controls today to build v.2010.3.1314.1040 [Download] [Trial] and I am now recieving an error when tryin to import using the htmlformatprovider:

     

    html =

     

    @"<img alt="" src=""http://www.google.com/images/logos/ps_logo2.png"" height=""20"" width=""20"" />";

     

     

     

    HtmlFormatProvider provider = new HtmlFormatProvider();

     

     

     

     

     

    var doc = provider.Import(html); <--- Throwing object reference not set to an instance of an object.

    Second. I really am trying my best to get our company to switch to silverlight with your UI suite. And, unfortunately I have been experiencing drawback after drawback. We are coming from a windows forms world but we're finding a lot of functionality is missing. For example, We do all of our confirmations and corresponance to our customers through html email for starters, and there is no good way to edit our html in a wysiwyg editor. I am trying to get the richtextbox editor to work for me, however it's not easy. I have to import the html, display it in another format, and export the html and hope that it rendors the same. On top of that, simple things like getting images to show up from url's doesn't work because supposedly there is a cross domain security policy. All the easy things that work now for us, do not work at all in silverlight. If you have any suggestions let me know. I am trying to my best to push your UI, but the little snags are giving management the no go.

     

  2. Ivailo Karamanolev
    Admin
    Ivailo Karamanolev avatar
    276 posts

    Posted 31 Jan 2011 Link to this post

    Hello Kyle Watson,

    Trying to load an image from an URL without cross-domain policy is impossible just using Silverlight\s WebClient. Gladly, the HtmlFormatProvider exposes an event, LoadImageFromUrl, through the ImportSettings property which will allow you to load necessary images yourself. This way, you can create a server-side WCF service to fetch images for you or any other way to load images without using the native Silverlight WebClient.

    Greetings,
    Ivailo
    the Telerik team
    Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
Back to Top