This question is locked. New answers and comments are not allowed.
Hi,
I am trying to use the RichTextBox to display rich text, in a read-only way (as described here: http://www.telerik.com/help/silverlight/radrichtextbox-how-to-use-rarichtextbox-as-rich-content-viewer.html). My problem is that I can't get anything but a white background. I would like the background to be transparent (or non-existent). I tried using the new TransparentTheme, and/or setting the background to Nothing but it does not work. Actually setting the background to any color (Background="Red") leaves me with a white background.
Is this a known issue or am I missing something here?
Thank you
I am trying to use the RichTextBox to display rich text, in a read-only way (as described here: http://www.telerik.com/help/silverlight/radrichtextbox-how-to-use-rarichtextbox-as-rich-content-viewer.html). My problem is that I can't get anything but a white background. I would like the background to be transparent (or non-existent). I tried using the new TransparentTheme, and/or setting the background to Nothing but it does not work. Actually setting the background to any color (Background="Red") leaves me with a white background.
Is this a known issue or am I missing something here?
Thank you
15 Answers, 1 is accepted
0
Accepted
Hi Nicolas,
To make the rich text box background transparent first you will have to set the Background property of the control to transparent. Then you will have to set the Background property in the default style of the presenter you will be using. In case of Flow layout mode this is the DocumentWebLayoutPresenter and in case of Paged layout mode this is the DocumentPrintLayoutPresenter. If you will be using both layout modes you can set both styles.
Here is how this can be done in XAML:
Sincerely yours,
Boby
the Telerik team
To make the rich text box background transparent first you will have to set the Background property of the control to transparent. Then you will have to set the Background property in the default style of the presenter you will be using. In case of Flow layout mode this is the DocumentWebLayoutPresenter and in case of Paged layout mode this is the DocumentPrintLayoutPresenter. If you will be using both layout modes you can set both styles.
Here is how this can be done in XAML:
<
telerik:RadRichTextBox
Background
=
"Transparent"
>
<
telerik:RadRichTextBox.Resources
>
<
Style
TargetType
=
"telerik:DocumentWebLayoutPresenter"
>
<
Setter
Property
=
"Background"
Value
=
"Transparent"
/>
</
Style
>
<
Style
TargetType
=
"telerik:DocumentPrintLayoutPresenter"
>
<
Setter
Property
=
"Background"
Value
=
"Transparent"
/>
</
Style
>
</
telerik:RadRichTextBox.Resources
>
</
telerik:RadRichTextBox
>
Sincerely yours,
Boby
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
0
Nicolas
Top achievements
Rank 1
answered on 16 Aug 2010, 07:51 AM
Hi Boby,
thank you for your response.
I'm creating the control in the code-behind and I'm having trouble implementing this. Could you please give me the equivalent in code-behind (VB preferred) please?
Thanks
thank you for your response.
I'm creating the control in the code-behind and I'm having trouble implementing this. Could you please give me the equivalent in code-behind (VB preferred) please?
Thanks
0
Accepted
Hi Nicolas,
Here's how to do the equivalent to the previously mentioned XAML in code-behind:
VB:
C#:
I hope this solves your problem. Let us know if you need further assistance.
Kind regards,
Ivailo
the Telerik team
Here's how to do the equivalent to the previously mentioned XAML in code-behind:
VB:
richTextBox.Background =
New
SolidColorBrush(Colors.Transparent)
richTextBox.Resources =
New
ResourceDictionary()
Dim
webLayoutStyle
As
New
Style(
GetType
(DocumentWebLayoutPresenter))
webLayoutStyle.Setters.Add(
New
Setter(DocumentWebLayoutPresenter.BackgroundProperty, Colors.Transparent))
richTextBox.Resources.Add(
GetType
(DocumentWebLayoutPresenter), webLayoutStyle)
Dim
printLayoutStyle
As
New
Style(
GetType
(DocumentPrintLayoutPresenter))
printLayoutStyle.Setters.Add(
New
Setter(DocumentPrintLayoutPresenter.BackgroundProperty, Colors.Transparent))
richTextBox.Resources.Add(
GetType
(DocumentPrintLayoutPresenter), printLayoutStyle)
richTextBox.Background =
new
SolidColorBrush(Colors.Transparent);
richTextBox.Resources =
new
ResourceDictionary();
Style webLayoutStyle =
new
Style(
typeof
(DocumentWebLayoutPresenter));
webLayoutStyle.Setters.Add(
new
Setter(DocumentWebLayoutPresenter.BackgroundProperty, Colors.Transparent));
richTextBox.Resources.Add(
typeof
(DocumentWebLayoutPresenter), webLayoutStyle);
Style printLayoutStyle =
new
Style(
typeof
(DocumentPrintLayoutPresenter));
printLayoutStyle.Setters.Add(
new
Setter(DocumentPrintLayoutPresenter.BackgroundProperty, Colors.Transparent));
richTextBox.Resources.Add(
typeof
(DocumentPrintLayoutPresenter), printLayoutStyle);
I hope this solves your problem. Let us know if you need further assistance.
Kind regards,
Ivailo
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
0
Nicolas
Top achievements
Rank 1
answered on 16 Aug 2010, 12:16 PM
Hi Ivailo,
thanks for the details. That worked out perfectly.
thanks for the details. That worked out perfectly.
0
Hello Nicolas,
It's good to hear this solution worked. Let us know if you have any other issues.
All the best,
Ivailo
the Telerik team
It's good to hear this solution worked. Let us know if you have any other issues.
All the best,
Ivailo
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
0
prog1
Top achievements
Rank 1
answered on 17 Sep 2010, 02:01 PM
If I use the transparent background, than I can see a white cursor if the textbox is not in focus.
How to change this to transparent? If I select the text the cursor changes from white to black, which is ok.
How to change this to transparent? If I select the text the cursor changes from white to black, which is ok.
0
prog1
Top achievements
Rank 1
answered on 21 Sep 2010, 09:03 AM
Can I change something like the CoursoAlternatingColor to "transparent" with a style, too?
0
Hello prog1,
We were unable to reproduce the "white cursor" problem - when the rich text box is not focused the caret is not shown. We will appreciate if you elaborate further and send us a sample project through the support system that exhibits the issue so we can investigate it locally.
Sincerely yours,
Alex
the Telerik team
We were unable to reproduce the "white cursor" problem - when the rich text box is not focused the caret is not shown. We will appreciate if you elaborate further and send us a sample project through the support system that exhibits the issue so we can investigate it locally.
Sincerely yours,
Alex
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
0
prog1
Top achievements
Rank 1
answered on 27 Sep 2010, 10:06 AM
Tried to reproduce it, but did not get it.
It's just in my real application.
Will try to get it later, again.
It's just in my real application.
Will try to get it later, again.
0
Hello Fabian,
Iva
the Telerik team
We are sorry that we are not able to offer you any solutions to your problem.
Feel free to get back to us when you reproduce it or if any other issues arise.
Iva
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
0
prog1
Top achievements
Rank 1
answered on 26 Jan 2011, 09:49 AM
I can reproduce it now.
Just got to ExpressionBlend, put a RadRichTextbox on a control without background.
Set the Background of the RadRichTextbox to "null" as well.
Now you can see the white cursor.
How can I change this to "null" or transparent, too?
Just got to ExpressionBlend, put a RadRichTextbox on a control without background.
Set the Background of the RadRichTextbox to "null" as well.
Now you can see the white cursor.
How can I change this to "null" or transparent, too?
0
Hello Fabian,
Iva
the Telerik team
I am sorry but I am still unable to reproduce the issue.
Since you have managed to isolate the problem in a simple project, would it be possible that you send it over in a support ticket? In this way we would be able to track down the problem and address it more easily.
Looking forward to your reply.
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>>
0
prog1
Top achievements
Rank 1
answered on 31 Jan 2011, 11:17 AM
After a lot of searching, I finally got the failure.
There was a wrong style definition, I did not see. So it was not a problem with the telerik control.
Thanks a lot and sorry it was my fault.
There was a wrong style definition, I did not see. So it was not a problem with the telerik control.
Thanks a lot and sorry it was my fault.
0
Toby Riley
Top achievements
Rank 1
answered on 08 Apr 2011, 01:39 PM
Hi,
I'm tying to set my cursor as white but cannot seem to do this. How did it happen for you?
Thanks T.
I'm tying to set my cursor as white but cannot seem to do this. How did it happen for you?
Thanks T.
0
Hi Tobias Riley,
Please find our answer in the following forum thread:
http://www.telerik.com/community/forums/silverlight/richtextbox/how-to-change-the-cursor-s-color.aspx
All the best,
Mike
the Telerik team
Please find our answer in the following forum thread:
http://www.telerik.com/community/forums/silverlight/richtextbox/how-to-change-the-cursor-s-color.aspx
All the best,
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