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

Transition with ReadOnly RadRichTextBox

1 Answer 46 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
Dan asked on 11 Apr 2012, 05:57 PM

I am using a RadRichTextBox as a Rich Content Viewer. (WPF 40)

What is the correct way to Bind TransitionControl with fadeEffect to a read-only RadRichTextBox (RRTB) control?

There is no user input in this process. (Remote display only)

The RadRichTextBox is loaded from Database with Html from code behind on a seperate thread every 5 seconds.  

Is there an example of binding RRTB Data Context to transition, or an example of binding a RRTB Data Template to transition?

Because it’s Read-only, How do I bind the changing Data (with HtmlFormatProvider or RRTB directly)

 Or is there a strictly XAML way to bind with declaratives?

I am trying to keep this as simple as possible.

What do I have to do to the following code to add Fade Transition to RadRichTextBox1?



<telerik:RadRichTextBox  x:Name="RadRichTextBox1"












VB - Code Behind Snippet:

            Dim HtmlMsg as String= MSG_TXT.ToString                             ‘  load  HTML from DB


             Me.RadRichTextBox1.IsSpellCheckingEnabled = False

             Me.RadRichTextBox1.Document = Me.htmlFormatProvider.Import(HtmlMsg)    

1 Answer, 1 is accepted

Sort by
Ivailo Karamanolev
Telerik team
answered on 17 Apr 2012, 09:35 AM

Here's a short code example that can get you started with TransitionControl and RadRichTextBox:
This can be replaced with your own model/data class:
    public class Model : INotifyPropertyChanged
        private string myProperty;
        public string MyProperty
                return this.myProperty;
                this.myProperty = value;
                if (this.PropertyChanged != null)
                    this.PropertyChanged(this, new PropertyChangedEventArgs("MyProperty"));
        public event PropertyChangedEventHandler PropertyChanged;
And this is the XAML you need:
        <telerik:RadTransitionControl Content="{Binding}">
                <telerikTransition:FlipWarpTransition />
                            <RowDefinition Height="*" />
                            <RowDefinition Height="*" />
                        <telerik:RadRichTextBox telerikHtml:HtmlDataProvider.Source="{Binding Path=MyProperty, Mode=TwoWay}" />
                        <TextBox Grid.Row="1" Text="{Binding Path=MyProperty, Mode=TwoWay}" />
When changing the property, you should not change the value, but rather the entire object TransitionControl is bound to.
Let us know if you need further assistance.

Ivailo Karamanolev
the Telerik team

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

Asked by
Top achievements
Rank 1
Answers by
Ivailo Karamanolev
Telerik team
Share this question