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

List Styles

5 Answers 242 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Erik
Top achievements
Rank 1
Erik asked on 04 Sep 2012, 03:09 PM
Hi,

We are currently using a RichTextBox to display simple HTML content.

To style the content, we are using this code:

this.htmlDataProvider.RichTextBox.DefaultStyleSettings.SetPropertyValue(Span.UnderlineColorProperty, foregroundColour);
this.htmlDataProvider.RichTextBox.DefaultStyleSettings.SetPropertyValue(Span.ForeColorProperty, foregroundColour);
this.htmlDataProvider.RichTextBox.Background = new SolidColorBrush(backgroundColour);
this.htmlDataProvider.RichTextBox.FontSize = this.noteStyles.DefaultFontSize;
this.htmlDataProvider.RichTextBox.FontFamily = new FontFamily(font.Source);

However, this leaves list icons and list numbers without a style applied: http://i.imgur.com/rbwx4.png

How can I apply a default style to those elements too?

Thanks.

5 Answers, 1 is accepted

Sort by
0
Alex
Telerik team
answered on 07 Sep 2012, 08:53 AM
Hi,

Unfortunately we couldn't reproduce the same results as the screenshot you've sent. Can you please assure that the DocumentInheritsDefaultStyleSettings property of the RadRichTextBox is set to true. This is needed so that all the DefaultStyleSettings form the rich text box control are copied to the imported document. 
If this doesn't work we would appreciate if you could send us the HTML document you are testing with so that we can investigate it thoroughly.

Regards,
Alex
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Erik
Top achievements
Rank 1
answered on 07 Sep 2012, 02:37 PM
So here's some example HTML. It's very simple markup:

<p><span>Test</span></p>
 
<ul>
    <li><span>Testing</span></li>
</ul>
 
<ol>
    <li><span>Testing</span></li>
    <li><span>Test</span></li>
</ol>
 
<p><span>Test</span></p>

We're assigning that to the RichTextBox by calling an (instance of the bound HtmlDataProvider) htmlDataProvider.Html = "our html string"

The XAML looks like this:

<Html:HtmlDataProvider
    Name="htmlDataProvider" 
    RichTextBox="{Binding ElementName=richTextBox}">
</Html:HtmlDataProvider>
<telerik:RadRichTextBox
    x:Name="richTextBox"
    DocumentInheritsDefaultStyleSettings="True">
</telerik:RadRichTextBox>

We seem to be able to manipulate every property but the color of the list items.

If you could post your code, showing how you would properly load an HTML document (and change the color of your bullet points, font-family etc), that'd be helpful.

Thanks.
0
Accepted
Mihail
Telerik team
answered on 11 Sep 2012, 12:31 PM
Hello Erik,

We still can't reproduce the problem. See the attached image which shows the result on our end.

I have also attached a demo project illustrating the correct behavior. Can you check it and tells us if the problem still exists?

Looking forward to your reply.

All the best,
Mihail
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Erik
Top achievements
Rank 1
answered on 13 Sep 2012, 02:57 PM
Hi,

Turns out the problem was that we were using the Q1 2012 version of the Telerik controls and when we updated to Q2 2012 the problem went away.

Thanks for the quick help anyway.
0
Mihail
Telerik team
answered on 14 Sep 2012, 11:46 AM
Hello Erik,

 Its nice to hear that you found a solution to your problem. If you have further questions feel free to contact us again.

Greetings,
Mihail
the Telerik team

Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.

Tags
RichTextBox
Asked by
Erik
Top achievements
Rank 1
Answers by
Alex
Telerik team
Erik
Top achievements
Rank 1
Mihail
Telerik team
Share this question
or