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

Two way Binding not working on second hit

4 Answers 94 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Tanuj
Top achievements
Rank 1
Tanuj asked on 19 Oct 2011, 10:33 AM
We are having RadRichTextBox in a user control and my user control is never disposed (means RadRichtextBox also),only visiblity of user control is toggled and we change the data inside usercontrol, every time
Now during first run, control gets intialised and data comes into radRichTextbox and goes out to binded poperty very well

Problem comes in second time, when same user contol is visible again with different set of data, radRichTextbox show same old value
I have tried clearing value, history everything and raisingPorpertyChange events explictly but nothing is working

Can you please help

4 Answers, 1 is accepted

Sort by
0
Boby
Telerik team
answered on 24 Oct 2011, 10:46 AM
Hello Tanuj,
Could you please provide more details on how you bind RadRichTextBox? Do you use our data providers? You can also open a support ticket and send us attached runnable sample project that reproduces the issue, so we can investigate it further.
Looking forward to your reply.

Regards,
Boby
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Tanuj
Top achievements
Rank 1
answered on 24 Oct 2011, 10:50 AM
I am using RADRichTextBox without Ribbon Bar and with HTML data provider, and using it like this

<telerik1:RadRichTextBox Grid.Row="8" Grid.Column="1" Grid.ColumnSpan="3" TabIndex="2"
                                                 IsContextMenuEnabled="True" IsSelectionMiniToolBarEnabled="True" IsSpellCheckingEnabled="True"
                                                 LayoutMode="Flow"  Margin="0" Name="txtdetails" MinHeight="15" BorderThickness="0"
                                                 VerticalAlignment="Stretch" DocumentInheritsDefaultStyleSettings="False"
                                                 Padding="0" MouseOverBorderThickness="0">
                            <telerik1:RadRichTextBox.Resources>
                                <RadHTMLDataProvider:HtmlDataProvider x:Key="HTMLDataProvider" RichTextBox="{Binding ElementName=txtdetails}" Html="{Binding Details,Mode=TwoWay,ValidatesOnDataErrors=True,NotifyOnValidationError=True}"></RadHTMLDataProvider:HtmlDataProvider>
                            </telerik1:RadRichTextBox.Resources>
                        </telerik1:RadRichTextBox>
0
Accepted
Iva Toteva
Telerik team
answered on 27 Oct 2011, 08:20 AM
Hello Tanuj,

As noted in this article, the data providers have to be in the visual tree, because otherwise their context is not properly updated.

In a nutshell, the change that you have to rewrite your XAML like this:

<telerik1:RadRichTextBox Grid.Row="8" Grid.Column="1" Grid.ColumnSpan="3" TabIndex="2" IsContextMenuEnabled="True" IsSelectionMiniToolBarEnabled="True" IsSpellCheckingEnabled="True" LayoutMode="Flow" Margin="0" Name="txtdetails" MinHeight="15" BorderThickness="0" VerticalAlignment="Stretch" DocumentInheritsDefaultStyleSettings="False" Padding="0" MouseOverBorderThickness="0" />
<RadHTMLDataProvider:HtmlDataProvider x:Name="HTMLDataProvider" RichTextBox="{Binding ElementName=txtdetails}" Html="{Binding Details,Mode=TwoWay,ValidatesOnDataErrors=True,NotifyOnValidationError=True}" />

You don't have to worry about the place in the visual tree where the provider is, as it does not have a visual representation.

Regards,
Iva Toteva
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Tanuj
Top achievements
Rank 1
answered on 27 Oct 2011, 09:44 AM
Thanks Iva it does solves the problem partially
Let me scratch my head for remaining part, will ping you again if required :)

-Tanuj
Tags
RichTextBox
Asked by
Tanuj
Top achievements
Rank 1
Answers by
Boby
Telerik team
Tanuj
Top achievements
Rank 1
Iva Toteva
Telerik team
Share this question
or