Transition with ReadOnly RadRichTextBox

2 posts, 0 answers
  1. Dan
    Dan avatar
    1 posts
    Member since:
    Dec 2011

    Posted 11 Apr 2012 Link to this post

    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?


    The XAML:

    <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)    

  2. Ivailo Karamanolev
    Ivailo Karamanolev avatar
    276 posts

    Posted 17 Apr 2012 Link to this post


    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 >>

Back to Top