Only show QuickAccessToolbar & ShowFindReplaceDialog Issue

2 posts, 0 answers
  1. Ash
    Ash avatar
    1 posts
    Member since:
    Aug 2014

    Posted 05 Aug 2014 Link to this post

    I am trying to create a simple richtextbox with line numbers and cut/paste/find/replace functionality.
     
    I have tried for several hours to find a way to collapse the rest of the ribbon and just show the quick access toolbar. I was able to set everything to collapsed but i am still left with extra space under toolbar.

    It also seems that the find and replace button does not open dialog as expected.

    Any help is GREATLY appreciated.


    This is what i have so far:

    <UserControl x:Class="....RichTextNumbers"
                 xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
            mc:Ignorable="d"
        d:DesignHeight="300" d:DesignWidth="400">
     
        <Grid x:Name="LayoutRoot" Background="White" DataContext="{Binding}">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
     
            <ListBox Grid.Column="0" BorderThickness="0" Name="oListBox" HorizontalContentAlignment="Left" IsTabStop="False"
                    Margin="3">
                <ListBox.ItemContainerStyle>
                    <Style TargetType="ListBoxItem">
                        <Setter Property="Padding" Value="0" />
                    </Style>
                </ListBox.ItemContainerStyle>
            </ListBox>
             
            <StackPanel Grid.Column="1">
                <telerik:RadRichTextBoxRibbonUI DataContext="{Binding Commands, ElementName=radRichTextBox}"
                            IsEnabled="True" Grid.Row="1" BackgroundVisibility="Collapsed" IsMinimized="True"
                                                    IsBackstageOpen="False" Background="Transparent"  Height="48"
                                                ApplicationButtonVisibility="Collapsed" CollapseThresholdSize="20,20"
                                                ApplicationName="" TitleBarBackground="Transparent" TitleBarVisibility="Visible" Title="">
     
                    <telerik:RadRichTextBoxRibbonUI.QuickAccessToolBar>
                            <telerik:QuickAccessToolBar Background="Transparent" BorderBrush="Transparent"
                                 CustomizationMenuVisibility="Collapsed" IsOverflowOpen="False">
                                <telerik:RadRibbonSplitButton
                                        telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding UndoCommand}" Size="Small"
                                        SmallImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/undo.png"
                                        Text="Undo" KeepOpen="False">
                                    <telerik:RadRibbonSplitButton.DropDownContent>
                                        <telerik:MultipleUndoControl
                                                telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding MultipleUndoCommand}" />
                                    </telerik:RadRibbonSplitButton.DropDownContent>
                                </telerik:RadRibbonSplitButton>
                                <telerik:RadRibbonButton
                                        telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding RedoCommand}" Size="Small"
                                        SmallImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/redo.png"
                                        Text="Redo" />
                                <telerik:RadRibbonButton
                                        telerik:ScreenTip.Description="Cut the selection and put it on the Clipboard."
                                        telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding CutCommand}" Size="Small"
                                        SmallImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/cut.png"
                                        Text="Cut" telerik:ScreenTip.Title="Cut" />
                                <telerik:RadRibbonButton
                                        telerik:ScreenTip.Description="Copy the selection and put it on the Clipboard."
                                        telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding CopyCommand}" Size="Small"
                                        SmallImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/copy.png"
                                        Text="Copy" telerik:ScreenTip.Title="Copy" />
                                <telerik:RadRibbonButton
                                        telerik:ScreenTip.Description="Paste the contents of the Clipboard."
                                        telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding PasteCommand}"
                                        Size="Small"
                                        SmallImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/paste.png"
                                        Text="Paste" telerik:ScreenTip.Title="Paste" />
                            <telerik:RadRibbonButton DataContext="{Binding Commands, ElementName=radRichTextBox}"
                                    telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=ShowFindReplaceDialogCommand}"
                                    Size="Medium"
                                    SmallImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/Find.png"
                                    Text="Find/Replace" />
                        </telerik:QuickAccessToolBar>
                        </telerik:RadRichTextBoxRibbonUI.QuickAccessToolBar>
                    </telerik:RadRichTextBoxRibbonUI>
                <telerik:RadRichTextBox Grid.Column="1" IsContextMenuEnabled="True" x:Name="radRichTextBox" Margin="3" BorderThickness="0" IsTabStop="True"/>
            </StackPanel>
        </Grid>
    </UserControl>
  2. Petya
    Admin
    Petya avatar
    975 posts

    Posted 08 Aug 2014 Link to this post

    Hello Ash,

    I'm not sure what exactly you are trying to achieve, would you please elaborate a bit?

    Generally, RadRichTextBox exposes commands that can be bound to any UI you want and it is not necessary to use RadRichTextBoxRibbonUI. For example, this SDK sample project demonstrates how to use the control with RadToolBar. 

    On a side note, I noticed that you placed the RadRichTextBox in your application in a StackPanel. Note that if the editor is in a container which measures its children with infinity, the virtualization would be disabled and this might lead to performance problems.

    Let me know if you have other questions.

    Regards,
    Petya
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
  3. DevCraft banner
Back to Top