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

White area is not expanded by default

2 Answers 46 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Ronald Evers
Top achievements
Rank 1
Ronald Evers asked on 21 May 2010, 04:01 PM
Hey,

Just a basic question about the rich text editor I guess. Basically I want a small area in my application in which users can enter text. Nothing too fancy, Im not trying to create a "Word looking" control, more a text area like the one I'm typing in right now when Im making this topic. The only problem I'm having is that the area in which I can type the text doesn't seem to exist until I click and start typing. Then it expands when I press enter. I really would like the white area where I can write in to be expanded to the entire control right away because right now it feels totally buggy. I attached a screenshot to show what I mean. Is there some setting I overlooked?

2 Answers, 1 is accepted

Sort by
0
Accepted
Mike
Telerik team
answered on 25 May 2010, 12:07 PM
Hi Ronald Evers,

This can be easily achieved by changing the default page UI template. You can try the following:

|
<UserControl x:Class="SilverlightApplication1.MainPage"
    xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Documents"
    xmlns:docUI="clr-namespace:Telerik.Windows.Documents.UI;assembly=Telerik.Windows.Documents"
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400">
 
    <Grid x:Name="LayoutRoot" Background="White" Width="300" Height="200">
    <Border BorderThickness="1" BorderBrush="Black">
      <telerik:RadRichTextBox x:Name="editor" Background="White">
        <telerik:RadRichTextBox.Resources>
          <Style TargetType="docUI:Page">
            <Setter Property="Template">
              <Setter.Value>
                <ControlTemplate TargetType="docUI:Page">
                  <ContentPresenter x:Name="PageContentPresenter"
                                              Visibility="Collapsed"/>
                </ControlTemplate>
              </Setter.Value>
            </Setter>
            <Setter Property="HorizontalAlignment" Value="Center" />
            <Setter Property="VerticalAlignment" Value="Top" />
          </Style>
        </telerik:RadRichTextBox.Resources>
      </telerik:RadRichTextBox>
    </Border>
  </Grid>
</UserControl>
Note that in the next version we will introduce separate templates that can be used when RadRichTextBox is viewed in Pages or Web layout modes.

Kind regards,
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.
0
Ronald Evers
Top achievements
Rank 1
answered on 25 May 2010, 04:25 PM
Thank you Mike, this has solved my problem and it's working the way I want it to now.
I'm really looking forward to the next release, I do need the text to HTML functions and this is only a temporary solution until you guys release the next version.
Anyway thanks for your help, keep up the good work!
Tags
RichTextBox
Asked by
Ronald Evers
Top achievements
Rank 1
Answers by
Mike
Telerik team
Ronald Evers
Top achievements
Rank 1
Share this question
or