Blank Text

2 posts, 0 answers
  1. Jeremy Cook
    Jeremy Cook avatar
    4 posts
    Member since:
    Aug 2007

    Posted 01 Feb 2011 Link to this post

    I have a richTextBox using a htmlDataProvider, however when it starts up the text is blank.

    I am able to select the text in the RichTextBox but the text is still blank. I am also able to write in the RichTextBox and the text is still blank.
    Here is the code, it's prett simple.

    Xaml

    <UserControl x:Class="RadControlsSilverlightApp1.MainPage"
                 xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"  
                 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                 xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
                 xmlns:docs="clr-namespace:Telerik.Windows.Documents.FormatProviders.Html;assembly=Telerik.Windows.Documents.FormatProviders.Html"
                 mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480"
                 Background="Black">
        <UserControl.Resources>
            <docs:HtmlDataProvider x:Key="html"
                                   RichTextBox="{Binding ElementName=rtb}"
                                   Html="{Binding html, Mode=TwoWay}">
            </docs:HtmlDataProvider>
        </UserControl.Resources>
      <Grid x:Name="LayoutRoot">
            <StackPanel>
                <telerik:RadRichTextBox x:Name="rtb" BorderBrush="Black" BorderThickness="1" IsSpellCheckingEnabled="False" />
                <TextBox Text="{Binding html,Mode=TwoWay}"/>
            </StackPanel>
      </Grid>
    </UserControl>

    Code Behind

    public partial class MainPage : UserControl
       {
           public MainPage()
           {
               InitializeComponent();
           this.DataContext = this
               this.Loaded += new RoutedEventHandler(MainPage_Loaded);
           }
           void MainPage_Loaded(object sender, RoutedEventArgs e)
           {
                this.html = "Some Text";
          }
           public string html
           {
               get { return (string)GetValue(htmlProperty); }
               set { SetValue(htmlProperty, value); }
           }
           // Using a DependencyProperty as the backing store for html.  This enables animation, styling, binding, etc...
           public static readonly DependencyProperty htmlProperty =
               DependencyProperty.Register("html", typeof(string), typeof(MainPage),null);
       }

    I am using version 2010.3.1018.1040

    thanks

     

  2. Iva Toteva
    Admin
    Iva Toteva avatar
    1319 posts

    Posted 01 Feb 2011 Link to this post

    Hi Jeremy Cook,

    This was a bug in the Q3.Beta (2010.3.1018), which we fixed immediately.
    If you upgrade to the official Q3 release (2010.3 1110), the Service Pack (2010.3 1314) or the latest internal build (2010.3 1331), the problem will be resolved.

    Greetings,
    Iva
    the Telerik team
    Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
Back to Top