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

System.Windows.Markup.XamlParseException

1 Answer 133 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
WILLIAM
Top achievements
Rank 1
WILLIAM asked on 28 Apr 2016, 07:27 PM

We are upgrading to the latest version of telerik (2016.1.217.1050).  All of our existing xaml for the RadRichTextBox is failing.  I've looked through the documentation and it doesn't have a specific example of how to define a TxtDataProvider.

The exact exception is telling me that the FormatProvider parameter is null and in your demo's, I do not see where you setting the FormatProvider property in the xaml.

I have the following:

<UserControl x ...
xmlns:telerikTxt="clr-namespace:Telerik.Windows.Documents.FormatProviders.Txt;assembly=Telerik.Windows.Documents"
    ...>
 
<!-- Then, based on an example in your demos, I have -->
 
<telerikTxt:TxtDataProvider Name="TxtDataProvider" RichTextBox="{Binding ElementName=uxSearchText}"/>
 
<telerik:RadRichTextBox x:Name="uxSearchText">
 
</UserControl>

But based on the exception, I'm assuming I should have something like this:

<telerikTxt:TxtDataProvider Name="TxtDataProvider" RichTextBox="{Binding ElementName=uxSearchText}" FormatProvider="SOMETHING SHOULD GO HERE"/>

Can you provide me with an example of how to define a TxtDataProvider/TxtFormatProvider in xaml?

Thanks!!

1 Answer, 1 is accepted

Sort by
0
Boby
Telerik team
answered on 03 May 2016, 10:30 AM
Hi William,

We've made a change in 2015 Q1 (listed in release notes as "Setting value to the bound property of a DataProvider can fail silently."), which basically adds one additional null check to reveal some situations which were previously failing silently. 

I was not able to reproduce the problem locally, but I believe that in your setup something is preventing the normal automatic registration of the TxtFormatProvider (RadRichTextBox uses MEF). You can manually register it by putting the following code somewhere before the XAML initialization:
DocumentFormatProvidersManager.RegisterFormatProvider(new TxtFormatProvider());

In case this doesn't help, you could open a support ticket and send us sample project reproducing the issue - this would help us investigate it thoroughly on our side.

Regards,
Boby
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Tags
RichTextBox
Asked by
WILLIAM
Top achievements
Rank 1
Answers by
Boby
Telerik team
Share this question
or