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

Looking for similar functionality from MS Word Shift F3 for Uppercase conversion

1 Answer 60 Views
Editor
This is a migrated thread and some comments may be shown as answers.
AkAlan
Top achievements
Rank 2
AkAlan asked on 08 Dec 2010, 05:56 PM
In MS Word I can select all the text, hit Shift F3 and it converts the text to All Lowercase, then if I hit Shift F3 again it will capitalize the first word in every sentence. Is there a way to do that with the radEditor?

1 Answer, 1 is accepted

Sort by
0
Accepted
Rumen
Telerik team
answered on 09 Dec 2010, 08:23 AM
Hi AkAlan,

The requested feature is not supported out-of-the box by RadEditor and it is not part of the advertised functionality of the control, but you can try to implement it yourself using the following code as a base.

You can attach to the onkeydown event of the content area and check for the execution of the Shift+F3 keys combination using this code:

<script type="text/javascript">
    function OnClientLoad(editor) {
        editor.attachEventHandler("keydown", function (e) {
             
            if (e.keyCode == 113 && e.shiftKey) {
                 
                 
            }
        });
    }
</script>
  
<telerik:radeditor
    runat="server"
    ID="RadEditor1"
    OnClientLoad="OnClientLoad">
</telerik:radeditor>

You can use the following RadEditor's commands to convert the selected content to Upper and Lower case letters:

editor.fire("ConvertToUpper");
editor.fire("ConvertToLower");

If you want to convert only the first letter of the sentence you will be able to do that using text Ranges, but it will be not an easy task. The following Wrox article could be helpful for your scenario too: Complex selection in DOM ranges. You can see the browsers' API differences listed in this article: W3C DOM Compatibility - Range.

Best regards,
Rumen
the Telerik team
Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
Editor
Asked by
AkAlan
Top achievements
Rank 2
Answers by
Rumen
Telerik team
Share this question
or