When i set the RadRichTextBox's background property in layoutmode property is normal,the background is effective.
But when the LayoutMode is paged the background property is invalid,and look like something shut out.
I want to set the background property in layoutmode is paged can be effectove,please help me(⊙_⊙)?
But when the LayoutMode is paged the background property is invalid,and look like something shut out.
I want to set the background property in layoutmode is paged can be effectove,please help me(⊙_⊙)?
3 Answers, 1 is accepted
0
Accepted
Hi Yunfan,
Hope this solves your problem. Do not hesitate to contact us if you have any further questions. Regards,
Martin
the Telerik team
You can do this by setting the print layout presenter background to transparent and then the background color of the rich text box will work properly:
<telerik:RadRichTextBox x:Name=
"radRichTextBox"
LayoutMode=
"Paged"
Grid.Row=
"2"
Background=
"Red"
>
<telerik:RadRichTextBox.Resources>
<Style TargetType=
"telerik:DocumentPrintLayoutPresenter"
>
<Setter Property=
"Template"
>
<Setter.Value>
<ControlTemplate TargetType=
"telerik:DocumentPrintLayoutPresenter"
>
<Border Background=
"Transparent"
>
<Grid>
<ContentPresenter />
<telerik:DropPositionMarker x:Name=
"DropPositionMarker"
/>
</Grid>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</telerik:RadRichTextBox.Resources>
</telerik:RadRichTextBox>
Hope this solves your problem. Do not hesitate to contact us if you have any further questions. Regards,
Martin
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0

Yunfan
Top achievements
Rank 1
answered on 14 Jan 2012, 10:15 AM
Sorry,my English is not good
I want to say is When RadRichTextBox's LayoutMode property is paged.The RadRichTextBox page's background is always white.
I want the page's background as same as the RadRichTextBox's background.
Please help me (⊙_⊙)?
I want to say is When RadRichTextBox's LayoutMode property is paged.The RadRichTextBox page's background is always white.
I want the page's background as same as the RadRichTextBox's background.
Please help me (⊙_⊙)?
0
Accepted
Hello Yunfan,
You can do this by applying the following style to the RadRichTextBox:
And also add the following styles to the resources:
the Telerik team
You can do this by applying the following style to the RadRichTextBox:
<telerik:RadRichTextBox Name=
"radRichTextBox"
Grid.Row=
"2"
LayoutMode=
"Paged"
>
<telerik:RadRichTextBox.Resources>
<Style TargetType=
"telerik:Page"
>
<Setter Property=
"Template"
>
<Setter.Value>
<ControlTemplate TargetType=
"telerik:Page"
>
<Grid>
<Border Padding=
"0"
BorderThickness=
"1"
BorderBrush=
"{StaticResource GridBorderBorderbrush}"
Margin=
"-1"
Background=
"{StaticResource GridBorderBackground}"
VerticalAlignment=
"Stretch"
HorizontalAlignment=
"Stretch"
Effect=
"{StaticResource DropShadowEffect}"
>
</Border>
<Canvas x:Name=
"PageContentPresenter"
Background=
"Green"
/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property=
"HorizontalAlignment"
Value=
"Center"
/>
<Setter Property=
"VerticalAlignment"
Value=
"Top"
/>
</Style>
</telerik:RadRichTextBox.Resources>
</telerik:RadRichTextBox>
And also add the following styles to the resources:
<UserControl.Resources>
<SolidColorBrush x:Key=
"GridBorderBorderbrush"
Color=
"Transparent"
/>
<SolidColorBrush x:Key=
"GridBorderBackground"
Color=
"#FFFFFFFF"
/>
<DropShadowEffect x:Key=
"DropShadowEffect"
BlurRadius=
"10"
ShadowDepth=
"0"
Opacity=
"0.4"
/>
<SolidColorBrush x:Key=
"PageContentPresenterBackground"
Color=
"#FFFFFFFF"
/>
</UserControl.Resources>
Don't hesitate to contact us if you have other questions.
Kind regards,
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>