Alignment problem in RadRichTextBox

13 posts, 0 answers
  1. Dennis
    Dennis avatar
    38 posts
    Member since:
    Aug 2010

    Posted 23 Feb 2011 Link to this post

    Hi,

    I am using a radrichtextbox inside a RadPane(Docking Control). I am using the Document property of radrichtextbox to display the contents since i need the HTML Support. Now the problem is that i want to display the content at the center of the RadPane both vertically and horizontally but unable to achieve this effect. If i am using the controls like TextBlock,Label,etc i am able to align the content at the center but through radrichtextbox i am not. Can you please help me out.

    Thanks in advance. 
  2. Andrew
    Admin
    Andrew avatar
    140 posts

    Posted 23 Feb 2011 Link to this post

    Hello David,

     We were not able to reproduce your issue. We are using the following code:

    <Grid x:Name="LayoutRoot">
        <telerik:RadDocking>
            <telerik:RadDocking.DocumentHost>
                <telerik:RadPaneGroup>
                    <telerik:RadPane Header="RadPane1">
                        <TextBox HorizontalAlignment="Center" VerticalAlignment="Center" />
                    </telerik:RadPane>
                    <telerik:RadPane Header="RadPane2">
                        <telerik:RadRichTextBox HorizontalAlignment="Center" VerticalAlignment="Center" />
                    </telerik:RadPane>
                    <telerik:RadPane Header="RadPane3">
                        <TextBlock Text="This is test!" HorizontalAlignment="Center" VerticalAlignment="Center" />
                    </telerik:RadPane>
                </telerik:RadPaneGroup>
            </telerik:RadDocking.DocumentHost>
        </telerik:RadDocking>
    </Grid>

    and everything seems to be working as expected. Every control here is in the center of the RadPane(Docking control). If we have misunderstood you in some way, please get back to us so we can assist you further.

    Kind regards,
    Andrew
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  3. DevCraft banner
  4. Dennis
    Dennis avatar
    38 posts
    Member since:
    Aug 2010

    Posted 06 Mar 2011 Link to this post

    Hi,

    Well so can you send me example which solves this issue. Let me clear that i am using a document property(RadRichTextBox1.Document) of RadRichTextBox to display the data since i needed a support for Html. So please send me the exaple where you are using the Document Property for RadRichTextBox and also please the RadRichTextBox has to be inside RadDocking.

    Thanks.
  5. Iva Toteva
    Admin
    Iva Toteva avatar
    1319 posts

    Posted 07 Mar 2011 Link to this post

    Hi David,

     
    Actually, the code-snippet Andrew provided in his post works if you are using the Q1 Beta (2011.1.0223). If you upgrade to it, you can see how RadRichTextBox gets centered both vertically and horizontally.

    In previous versions of the control, you can center the rich text box vertically if you put it in a Grid with VerticalAlignment="Center" and in a row with Height="Auto" like this:

    Copy Code
    <Grid VerticalAlignment="Center">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
       
        <Border BorderBrush="Red" BorderThickness="1">
            <telerik:RadRichTextBox Name="editor" />
        </Border>
    </Grid>

    However, it would not be possible to adopt the same approach for the Width and the rich text box would stretch across the screen.
    Please find attached a small demo illustrating how the Horizontal and VerticalAlignment properties work. Do not forget to set the references to point to the 0223 version of the assemblies. In the example, the HTML that is loaded in the rich text box is included as a file in the project. If you want to use data-binding, you should use a data provider, as described in this help article.
    If you need further assistance, do not hesitate to get back to us.

    All the best,
    Iva
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  6. Dennis
    Dennis avatar
    38 posts
    Member since:
    Aug 2010

    Posted 08 Mar 2011 Link to this post

    I am currently using 2010.3.1110.1040 version for Silverlight. Well how to download the version(2011.1.0223) you specified? I cannot find this version in my license account. How can i solve this problem with my current version inside a Radocking Control. Urgent solution would be really appreciated. I have used RadHtmlPlaceHolder in the past but due to the problems in that control of compulsorily setting windowless property and all i was been suggested to use RadRichTextBox by your team and now this control seems to have all these alignment problems which is really now turning out to be frustrating. 

     
  7. Iva Toteva
    Admin
    Iva Toteva avatar
    1319 posts

    Posted 09 Mar 2011 Link to this post

    Hi David,

    You can download an automatic or manual installer from your account under the header "Beta".
    With the current version of the controls you are using, you can only center the content horizontally, as in the code-snippet in my previous post.
    Let us know if you need anything else.

    Best wishes,
    Iva
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  8. JanwalkarPooja
    JanwalkarPooja avatar
    20 posts
    Member since:
    Jan 2013

    Posted 04 Jul 2013 Link to this post

    Hi Team,

     In my project i am also facing alignment problem inside RadRichTextBox.
     <telerik:RadRichTextBox x:Name="richTextBox" ScrollViewer.VerticalScrollBarVisibility="Auto"
                                                                                        Grid.Row="0" Width="980" MaxWidth="980"
                                                                                        Grid.Column="0" Padding="10,0,0,0"
                                                                                        Height="100" VerticalContentAlignment="Stretch" VerticalAlignment="Center"    HorizontalContentAlignment="Center"
                                                                                        IsReadOnly="True" HorizontalAlignment="Right"
                                                                                        IsSpellCheckingEnabled="False"                                                                                                                                                                        
                                                                                          IsSelectionMiniToolBarEnabled="False"                                                                                                                                                  
                                                                                        IsContextMenuEnabled="False"
                                                                                        IsSelectionEnabled="False"
                                                                                        />
                                                                <telerikhtml:HtmlDataProvider x:Name="HtmlDataProvider"
                                                                                              Html="{Binding EmailBody}"
                                                                                              RichTextBox="{Binding ElementName=richTextBox}" />

    Inside RichTextBox control, table structure is build with code behind binding.
    I need Content of table should properly aligned with header.
    PFA of image,in that After maximize (expanding) particular one row Grid RadRichTextBox shows up.In that,Column 1 Header content and value is misaligned with table structure.
    Please provide the solution for this issue.
    I am looking forward your reply.

  9. JanwalkarPooja
    JanwalkarPooja avatar
    20 posts
    Member since:
    Jan 2013

    Posted 10 Jul 2013 Link to this post

    Hi Team,

     In my project i am also facing alignment problem inside RadRichTextBox.
     <telerik:RadRichTextBox x:Name="richTextBox" ScrollViewer.VerticalScrollBarVisibility="Auto"
                                                                                        Grid.Row="0" Width="980" MaxWidth="980"
                                                                                        Grid.Column="0" Padding="10,0,0,0"
                                                                                        Height="100" VerticalContentAlignment="Stretch" VerticalAlignment="Center"    HorizontalContentAlignment="Center"
                                                                                        IsReadOnly="True" HorizontalAlignment="Right"
                                                                                        IsSpellCheckingEnabled="False"                                                                                                                                                                        
                                                                                          IsSelectionMiniToolBarEnabled="False"                                                                                                                                                  
                                                                                        IsContextMenuEnabled="False"
                                                                                        IsSelectionEnabled="False"
                                                                                        />
                                                                <telerikhtml:HtmlDataProvider x:Name="HtmlDataProvider"
                                                                                              Html="{Binding EmailBody}"
                                                                                              RichTextBox="{Binding ElementName=richTextBox}" />

    Inside RichTextBox control, table structure is build with code behind binding.
    I need Content of table should properly aligned with header.
    PFA of image.
    Please provide the solution for this issue.
    I am looking forward your reply.


    Regards,
    Pooja
  10. Amruta
    Amruta avatar
    11 posts
    Member since:
    Mar 2015

    Posted 27 Mar 2015 Link to this post

    Hi I am using RadRichTextBox inside stackpanel. 
    When I open ribbon menu , height of textbox increases I want to keep height same even if editor ribbon open or close
    Can anybody please help, this is urgent???

    Thanks.
  11. Petya
    Admin
    Petya avatar
    975 posts

    Posted 31 Mar 2015 Link to this post

    Hello Amruta,

    I'm having troubles understanding the issue you are facing. Could you share more information on the setup? What is the height of the control prior opening the ribbon and how are the controls positioned? It might help if you share your XAML and some images of the observed behavior.

    Regards,
    Petya
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
  12. Amruta
    Amruta avatar
    11 posts
    Member since:
    Mar 2015

    Posted 31 Mar 2015 in reply to Petya Link to this post

    Hi,

    Ok I will explain probelm in detail.
    I have RadRichTextbox with RadRibbon minimized. I want to set ribbon open(Isminimized="false") when user click on any button/tab of RadRibbon. Like if I click on Home tab then ribbon should be open (Isminimized="false") so that cursor will automatically set to appropriate location. Please see screen shot. 
  13. Petya
    Admin
    Petya avatar
    975 posts

    Posted 03 Apr 2015 Link to this post

    Hi Amruta,

    Moving the caret to the location shown on the image is not possible. By default when the ribbon is minimized and you click on it, it is shown as a popup, so it's expected for it to be over the editor. In fact, the behavior is the same in most word processors, for example MS Word.

    Try subscribing to the PreviewPopupOpened event of the ribbon and setting IsMinimized to false to see if it fits your needs:
    private void RadRichTextBoxRibbonUI_PreviewPopupOpened(object sender, Telerik.Windows.RadRoutedEventArgs e)
    {
        this.radRichTextBoxRibbonUI.IsMinimized = false;
         
        e.Handled = true;
    }

    Regards,
    Petya
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
  14. Amruta
    Amruta avatar
    11 posts
    Member since:
    Mar 2015

    Posted 03 Apr 2015 in reply to Petya Link to this post

    Hi Petya Thanks a lot ...thats working fine. 
    I guess what I was missing in my all attempts is e.Handled = true;

    Anyways thanks again !
Back to Top
DevCraft banner