SelectionMiniToolBar

12 posts, 1 answers
  1. Daní
    Daní avatar
    303 posts
    Member since:
    Feb 2008

    Posted 26 Nov 2010 Link to this post

    Hi,

    I'd like to enable selection toolbar and also customize it to only show the Copy button. I've tried to set the IsSelectionMiniToolbarEnabled to true, just to see the default MiniToolBar but nothing is shown when any text is selected. Can somebody help me?
    Thanks

     

  2. Iva Toteva
    Admin
    Iva Toteva avatar
    1319 posts

    Posted 26 Nov 2010 Link to this post

    Hello Daní,

    In order to use SelectionMiniToolBar and ContextMenu, you need to add a reference to Telerik.Windows.Controls.RichTextBoxUI.

    As it comes to customizing the SelectionMiniToolBar, we have a blogpost just for this purpose. You can find it here. Check it out and let us know if you need further assistance.

    Best wishes,
    Iva
    the Telerik team
    Browse the videos here>> to help you get started with RadControls for Silverlight
  3. DevCraft banner
  4. Daní
    Daní avatar
    303 posts
    Member since:
    Feb 2008

    Posted 26 Nov 2010 Link to this post

    Hi Iva

    Is not running in my labtop.

    Telerik.Windows.Controls.RichTextBoxUI reference was already added. I've made a very simple new solution, MainPage.xaml code is as follows:
    <UserControl x:Class="SearchAndHighlight.MainPage"
         mc:Ignorable="d" d:DesignHeight="341" d:DesignWidth="852"
      
        <Grid x:Name="LayoutRoot" Background="White">
            <telerik:RadRichTextBox IsSpellCheckingEnabled="False" Name="radRichTextBox" IsSelectionMiniToolBarEnabled="True"/> 
        </Grid>
    </UserControl>

    The project has references to the next telerik assemblies:
    Telerik.Windows.Controls
    Telerik.Windows.Controls.Input
    Telerik.Windows.Controls.Navigation
    Telerik.Windows.Controls.RibbonBar
    Telerik.Windows.Controls.RichTextBoxUI
    Telerik.Windows.Documents
    Telerik.Windows.Documents.FormatProviders.Xaml

    Telerik's assemblies version is 2010.3.1110.1040

  5. Iva Toteva
    Admin
    Iva Toteva avatar
    1319 posts

    Posted 29 Nov 2010 Link to this post

    Hi Daní,

    Could you please provide a sample project for us to investigate the matter? You are the first person to report such an issue with the selection mini toolbar.
    Thank you.

    Kind regards,

    Iva
    the Telerik team
    Browse the videos here>> to help you get started with RadControls for Silverlight
  6. Daní
    Daní avatar
    303 posts
    Member since:
    Feb 2008

    Posted 29 Nov 2010 Link to this post

    It has an extrange behavior.

    Last Friday, I couln't see any SelectionMiniToolbar, even when creating an empty new solution with only one RichTextBox as main page content. Now, It's running in this scenario, but not in my real solution where I'm using RichTextBox in readnly mode inside the ItemTemplate of ListBox control. So, I want to use richt text box as the content of ListBox items, and I want to see the selection mini toolbar each time the user selects text in any richt text box.
  7. Answer
    Boby
    Admin
    Boby avatar
    595 posts

    Posted 30 Nov 2010 Link to this post

    Hi Daní,

    Unfortunately, SelectionMiniToolBar cannot be used when RadRichTexBox.IsReadOnly is true. However your proposition will be taken into consideration and selection mini toolbar would be shown regardless of the value of IsReadOnly property - this will be useful in cases like yours, when custom selection mini toolbars contain only commands that preserve document structure.

    We will make changes immediately and the features will be available in the next LIB (expected around the beginning of the next week).

    Points in your account have been updated in appreciation.

    Kind regards,
    Boby
    the Telerik team
    Browse the videos here>> to help you get started with RadControls for Silverlight
  8. Daní
    Daní avatar
    303 posts
    Member since:
    Feb 2008

    Posted 09 Dec 2010 Link to this post

    Hi Boby,

    Do you know if the LIB with the updates to make visible SelectionMiniToolbar when RichTextBox is in ReadOnlyMode is already available?

    thanks.
  9. Boby
    Admin
    Boby avatar
    595 posts

    Posted 09 Dec 2010 Link to this post

    Hi Daní,
    Yes, we managed to include these changes in the LIB from 8 Dec, which should be already visible in your Telerik account.

    All the best,
    Boby
    the Telerik team
    Browse the videos here>> to help you get started with RadControls for Silverlight
  10. Daní
    Daní avatar
    303 posts
    Member since:
    Feb 2008

    Posted 09 Dec 2010 Link to this post

    Thanks Boby,

    It's running fine. Just one last question about this. How can I modify the SelectionMiniToolBar animation? It sems that when shownig the SelectionMiniToolbar, a opacity animation is played. I'd like to remove this animation to force the toolbar appearing inmediately.

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

    Posted 11 Dec 2010 Link to this post

    Hi Daní,

    When you are implementing a custom selection mini toolbar and you do not want to see an animation, you can implement that logic in the SetOpacity() method, which is a part of ISelectionMiniToolBar interface.

    If you want to use the default SelectionMiniToolBar, you have to do something similar, as currently, the methods that it exposes are not virtual and cannot be overridden (in case you decide to extend it by inheriting it). We will consider allowing that in the future, but as a workaround, you can create a custom selection mini toolbar that has a default SelectionMiniToolBar as a field. Something like the following code should do the trick:

    [Telerik.Windows.Documents.UI.Extensibility.CustomSelectionMiniToolBar]
    public partial class ExtendedSelectionMiniToolBar : ISelectionMiniToolBar
    {
        SelectionMiniToolBar original;
     
        public ExtendedSelectionMiniToolBar()
        {
            original = new SelectionMiniToolBar();
        }
     
        public double Height
        {
            get { return original.Height; }
        }
     
        public void Hide()
        {
            original.Hide();
        }
     
        public void SetOpacity(double opacity)
        {
            original.SetOpacity(1);
        }
     
        public void Show(Point location, RadRichTextBox radRichTextBox)
        {
            original.Show(location, radRichTextBox);
        }
     
        public double Width
        {
            get { return original.Width; }
        }
    }

    Regards,
    Iva
    the Telerik team
    Browse the videos here>> to help you get started with RadControls for Silverlight
  12. Daní
    Daní avatar
    303 posts
    Member since:
    Feb 2008

    Posted 05 Jan 2011 Link to this post

    Hi,

    Is there any example on how to customize the SelectionMiniToolbar? I have a readonly textblock and I want the SelectionMiniToolbar containing just one button with Copy Command. I've tried several approaches with no succes!

    Thanks.
  13. Boby
    Admin
    Boby avatar
    595 posts

    Posted 07 Jan 2011 Link to this post

    Hello Daní,
    I have prepared you a sample project that demonstrates how to create a custom selection mini toolbar with Copy button. As we discussed earlier you should use LIB assemblies (from 8.Dec or later) in order for it to be shown when RadRichTextBox is in read-only mode (these changes will also be included in Q3 SP1 expected in a couple of weeks).

    Don't hesitate to contact us if you have other questions.

    All the best,
    Boby
    the Telerik team
    Browse the videos here>> to help you get started with RadControls for Silverlight
Back to Top
DevCraft banner