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
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:
<scripttype="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:
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.