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

Blank Text

1 Answer 68 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Jeremy Cook
Top achievements
Rank 1
Jeremy Cook asked on 01 Feb 2011, 07:24 AM

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

 

1 Answer, 1 is accepted

Sort by
0
Iva Toteva
Telerik team
answered on 01 Feb 2011, 06:10 PM
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>>
Tags
RichTextBox
Asked by
Jeremy Cook
Top achievements
Rank 1
Answers by
Iva Toteva
Telerik team
Share this question
or