MiniToolBar on RadRichText

2 posts, 1 answers
  1. Chris
    Chris avatar
    14 posts
    Member since:
    Apr 2014

    Posted 04 Apr 2014 Link to this post

    Hi,
    I am having multiple issues around the mini tool bar, the main issue is that when a user uses the select all command(Ctrl + a) this tool bar doesn't show.
    Second issue is the tool bar visibility is very temperament so is there anyway to make it permanently visible when there are selected items - and possibly add the ability to move/dock this.
    Any help would be appreciated.
    Thanks
    -Chris
  2. Answer
    Petya
    Admin
    Petya avatar
    975 posts

    Posted 09 Apr 2014 Link to this post

    Hi Chris,

    The default behavior of the SelectionMiniToolBar in RadRichTextBox is to be visible when selection has been made using the mouse which is why selecting the whole content of the control or making selection using the keyboard would not invoke the toolbar. 

    I'm afraid that there is no way to modify the behavior of toolbars' visibility in RadRichTextBox. What I would suggest is to create some sort of custom popup containing the same or similar controls bound to RadRichTextBox's commands and show it when desired.

    In regard to the selection in the control, you can be notified when it changes if you subscribe to the SelectionChanged event:
    this.radRichTextBox.Document.Selection.SelectionChanged += Selection_SelectionChanged;
    Additionally, whether the selection is empty can be determined using the IsEmpty property:
    var isEmpty = this.radRichTextBox.Document.Selection.IsEmpty;
    Note that if a single image is selected the IsEmpty property would be false. The following snippet shows how you can determine whether the selection contains a single inline image:
    ImageInline image = this.radRichTextBox.Document.Selection.GetSelectedSingleInline() as ImageInline;
    if (image != null)
    {
        bool selectionIsImage = true;
    }

    I hope this is helpful. Let me know if you need further assistance.

    Regards,
    Petya
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top