SfRichTextBoxAdv Horizontal Scroll Bar

To whom it may cocern,

I am trying to show two SfRichTextBoxAdv inside a ScrollViewer. I would like to disable the SfRichTextBoxAdv's scrollbars and use the father ScrollViewer to scroll both SfRichTextBoxAdvs. In other words, I would like them to behaivour as a normal TextBox. You can see and example of the code below.

<Window x:Class="WpfApplication3.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:WpfApplication3"
        xmlns:syncfusion="http://schemas.syncfusion.com/wpf"
        mc:Ignorable="d"
        Title="MainWindow" Height="350" Width="525">
    <ScrollViewer HorizontalAlignment="Stretch" HorizontalScrollBarVisibility="Visible">
        <Grid HorizontalAlignment="Stretch">
            <Grid.RowDefinitions>
                <RowDefinition></RowDefinition>
                <RowDefinition></RowDefinition>
            </Grid.RowDefinitions>
            <syncfusion:SfRichTextBoxAdv Grid.Row="0" HorizontalAlignment="Stretch" Width="500" HorizontalScrollBarVisibility="False"></syncfusion:SfRichTextBoxAdv>
            <syncfusion:SfRichTextBoxAdv Grid.Row="1" HorizontalAlignment="Stretch" Width="500"  HorizontalScrollBarVisibility="False" ></syncfusion:SfRichTextBoxAdv>
        </Grid>
    </ScrollViewer>
</Window>


Kind regards,
Pablo

1 Reply

VM Venkatesan Mani Syncfusion Team May 16, 2018 06:49 AM UTC

Hi Pablo,

Thank you for using Syncfusion products.

Our SfRichTextBoxAdv control does not have options to disable scrolling. Also, it does not resize its height based on its content. The properties “HorizontalScrollBarVisibility” and “VerticalScrollBarVisibility” used to show/hide the scrollbars and it does not disable the scrolling.

If your requirement is to do the scroll contents of SfRichTextBoxAdv based on ScrollViewer scroll action, then you can achieve this by perform programmatic scroll in SfRichTextBoxAdv at sample level based on ScrollViewer scroll action. Kindly refer the following KB article for performing programmatic scroll in SfRichTextBoxAdv,

KB link: https://www.syncfusion.com/kb/7771/how-to-scroll-sfrichtextboxadv-programmatically

If this is not your use case, kindly share us brief explanation of your requirement clearly.

For your information, Our SfRichTextBoxAdv control will be displayed with default size (200 x 200), when placed in controls/panels which will measure it with infinity. For example, ScrollViewer, StackPanel and Grid with Row.Height="Auto" or Column.Width="Auto" will measure with infinity. So, set the desired height to the Height property of SfRichTextBoxAdv. Otherwise use SfRichTextBoxAdv inside controls/panels which will measure proper height for its children. For example, Grid with Row.Height=” *”. This is also applicable for the templates and styles.

Also, could you please provide us the following required details? It will be helpful us to provide appropriate solution at the earlier,

1. Are you using SfRichTextBoxAdv to view/edit the content in Page by Page or Web(Flow) layout?
2. Whether the SfRichTextBoxAdv contents are editable or non-editable?
3. If the content of SfRichTextBoxAdv is non-editable (like Text Block) then you can use the Block Layout mode to view the contents. In Block layout mode, the height of the SfRichTextBoxAdv will be resized based its content.

Regards,
Venkatesan M. 


Loader.
Up arrow icon