darson1991
darson1991

Reputation: 406

Binding in RadRichTextBox (WPF)

I read some threads on telerik forum and here on this topic and I produced the following code in xaml:

 <Grid>           
     <telerik:XamlDataProvider x:Name="XamlDataProvider" Xaml="{Binding xxx}"
          RichTextBox="{Binding ElementName=RadRichTextBox}"/>
     <telerik:RadRichTextBox x:Name="RadRichTextBox" IsSpellCheckingEnabled="False"/>
     <!--<TextBlock Text="{Binding xxx}"></TextBlock>-->
</Grid>

The xxx is a string property in my view model which has xaml string of RadRichTextBox Document. The data from RadRichTextBox document I convert to xaml and save in database and when I open a window I want to display it in RadRichTextBox. Now it's don't work. When I uncomment the line with textblock then in it there is the xaml string so datacontex should be good.

Upvotes: 1

Views: 1404

Answers (1)

darson1991
darson1991

Reputation: 406

<telerik:RadRichTextBox x:Name="RadRichTextBox" IsSpellCheckingEnabled="False" telerik:XamlDataProvider.Source="{Binding xxx}" />

It fixed my problem

Upvotes: 1

Related Questions