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

Request for full working real-world sample

1 Answer 55 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Daniel Billingsley
Top achievements
Rank 1
Daniel Billingsley asked on 19 Sep 2010, 02:56 AM
Can you create a real sample of this control like you'd actually use it in the real world?  Please consider the following:

  1. Project contains SampleDataObject1 and SampleDataObject2, which are instances of SampleDataObject, which contains the following property:
    public string HtmlBody { get; set; }
  2. Silverlight page contains a RichTextBox on it.  We want the default start font of Verdana size 12 for it.
  3. There is a button for setting the page's DataContext to each of the two SampleDataObject instances (one button for each object).
  4. Binding is set up for the RichTextBox so that the Html representation of its contents (through the HtmlDataPovider) is bound to the HtmlBody property of the DataContext (the currently selected SampleDataObject instance).
  5. There is a button to toggle the Bold state, and another to toggle Italics, in the RichTextBox.
  6. And here's the big one - since we want to reuse this component all over our application, we want to put all the RichTextBox parts in a UserControl.  That means the UserControl should include the formatting buttons and have a Html property that we'd use for the Binding (i.e. the creator of the Page wouldn't know anything about any HtmlDataProvider).

1 Answer, 1 is accepted

Sort by
0
Mike
Telerik team
answered on 22 Sep 2010, 09:15 AM
Hello Daniel Billingsley,

I modified a bit a sample (attached) with UserControl that uses RadRichTextBox and exposes Html property, initially posted in the following thread:
http://www.telerik.com/community/forums/silverlight/richtextbox/how-do-you-bind-richtextbox.aspx#1261433

Note that in this scenario you do not have to use HtmlDataProvider since it is need only when bind anything to RadRichTextBox. In this case you can use directly the HtmlFormatProvider. I also added some code to set the initial font/size of RadRichTextBox. The sample is built against Q2 SP1 version.

I am afraid currently we do not have any sample with all requirements you specified. If you have already started working on application that resembles this sample we will help you with any problems that you are not able to resolve. You can open a support ticket and send us the sample and describe the problems.

Greetings,
Mike
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
RichTextBox
Asked by
Daniel Billingsley
Top achievements
Rank 1
Answers by
Mike
Telerik team
Share this question
or