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

HtmlDataProvider binding error after Q1 2015 update

3 Answers 175 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Sergey
Top achievements
Rank 1
Sergey asked on 06 Apr 2015, 10:18 PM
Hello,

In one of the projects of our solution, I’m getting the following error when binding HtmlDataProvider to RadRichTextBox:

Value cannot be null. Parameter name: formatProvider
The invocation of the constructor on type 'Telerik.Windows.Documents.FormatProviders.Html.HtmlDataProvider' that matches the specified binding constraints threw an exception. [Line: 386 Position: 55].

That exception seems to be thrown from the constructor of DataProviderBase and I get it even if I switch to TxtDataProvider. It doesn’t help that the same
binding works in other projects of the same solution :(

Version that worked before updating to 2015.1.0401.1050 NoXaml – 2014.3.1024.1050 NoXaml
All references set according to http://docs.telerik.com/devtools/silverlight/controls/radrichtextbox/getting-started/getting-started

Here’s what I have left in the user control:

<UserControl x:Class="Cebos.Veyron.Search.Views.Details.EmailView"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
             xmlns:telhtml="clr-namespace:Telerik.Windows.Documents.FormatProviders.Html;assembly=Telerik.Windows.Documents.FormatProviders.Html"
             mc:Ignorable="d">
 
    <Grid Background="White">
        <telhtml:HtmlDataProvider Html="{Binding HtmlContent, Mode=TwoWay}" RichTextBox="{Binding ElementName=HtmlRichTextBox}" />
        <telerik:RadRichTextBox x:Name="HtmlRichTextBox" />
    </Grid>
</UserControl>

Thank you,
Sergey

3 Answers, 1 is accepted

Sort by
0
Petya
Telerik team
answered on 09 Apr 2015, 03:36 PM
Hello Sergey,

The data providers rely on format provider instances registered when the control is loaded. This happens with the help of MEF and it is possible that the provider hasn't been registered yet. In previous versions of the control this would simply silently fail and the binding wouldn't work, but in the resent release we tried to make sure the users are notified about the error.

Try setting the TypeCatalog needed by MEF from this article and see if the issue persists.

I hope this helps.

Regards,
Petya
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
0
Sergey
Top achievements
Rank 1
answered on 09 Apr 2015, 04:59 PM

Hello Petya,

Thank you so much, that was indeed the issue!
We were initializing Telerik catalog inside of our own OnImportsSatisfied() which was too late.

One remaining minor issue in this release (or in our code?) is that we had to reference Telerik.Windows.Documents.dll in order to use txt provider and this dll exposes System.Serializable, so I had to use 'extern alias' to work around it.

Thank you again,
Sergey

0
Sergey
Top achievements
Rank 1
answered on 10 Apr 2015, 06:39 PM

Just FYI,

Last issue fixed by using Telerik Document Processing Library from Telerik UI for ASP.NET AJAX.

http://www.telerik.com/help/aspnet-ajax/introduction-included-assemblies.html

Thanks,
Sergey

 

Tags
RichTextBox
Asked by
Sergey
Top achievements
Rank 1
Answers by
Petya
Telerik team
Sergey
Top achievements
Rank 1
Share this question
or