This is a migrated thread and some comments may be shown as answers.

MiniToolBar on RadRichText

1 Answer 97 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 04 Apr 2014, 03:52 PM
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

1 Answer, 1 is accepted

Sort by
0
Accepted
Petya
Telerik team
answered on 09 Apr 2014, 01:21 PM
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.

 
Tags
RichTextBox
Asked by
Chris
Top achievements
Rank 1
Answers by
Petya
Telerik team
Share this question
or