HtmlDataProvider.FormatProvider is null

3 posts, 0 answers
    WILLIAM avatar
    134 posts
    Member since:
    Jun 2012

    Posted 19 Mar 2014 Link to this post

    We have recently updgraded to the lastest version of Telerik controls for silverlight and running into a lot of issues.

    Before the upgrade, I had this snippet of code, where I'm assuming that by creating the HtmlDataProvider, the FormatProvider was created as well without any additional logic.  I had immediate access to the FormatProvider
    HtmlDataProvider = new HtmlDataProvider();
    var provider = (HtmlFormatProvider)HtmlDataProvider.FormatProvider;
    provider.ExportSettings = new HtmlExportSettings
                                ImageExportMode = ImageExportMode.UriSource,
                                DocumentExportLevel = DocumentExportLevel.Fragment,
                                StylesExportMode = StylesExportMode.Inline

    Now this same block of code causes a NullReference Exception because FormatProvider is null.

    What changed, and how do I fix it?

    WILLIAM avatar
    134 posts
    Member since:
    Jun 2012

    Posted 19 Mar 2014 in reply to WILLIAM Link to this post

    I figured it out.

    I wish you guys would take into consideration the ramifications of things that are major code breakers.  We have a very large application and this instance, along with obsoleting controls, methods, and or properties has caused major problems and great deal of work re-writing a lot of code. I'm on day 4 of implementing this upgrade, and I'm not anywhere near being finished.  My boss is considering pulling the upgrade.


  3. DevCraft banner
  4. Mihail
    Mihail avatar
    183 posts

    Posted 20 Mar 2014 Link to this post

    Hello William,

    Sorry to hear that you have troubles upgrading the version of Telerik UI for Silverlight used in your application. We do our best to avoid breaking changes and only introduce such when absolutely necessary. Additionally, all controls have articles explaining how to deal with such changes, the following one explains the compatibility between different versions of RadRichTextBox: Backward Compatibility.

    Regarding the problem you have encountered related to HtmlDataProvider, I'm afraid I was unable to reproduce that. The HtmlFormatProvider is available in HtmlDataProvider and we haven't introduced any changes in this regard. Nevertheless I am glad to hear that you managed to fix the issue.

    If you find further obstacles upgrading the controls or you have questions feel free to contact us again.


    Build cross-platform mobile apps using Visual Studio and .NET. Register for the online webinar on 03/27/2014, 11:00AM US ET.. Seats are limited.

Back to Top