When using Ctrl+Left to navigate the rich text, when the cursor is at the end of a word, or inside a word, Ctrl+Left goes to the start of the previous word. It should go to the start of the current word.
Is there a work-around for this? Can it be fixed?
Is there a work-around for this? Can it be fixed?
3 Answers, 1 is accepted
0
Accepted
Hi Jason,
Thank you for writing.
I was able to reproduce this issue and I have logged it in our Feedback Portal. You can track the item for status changes and add your vote for it here.
To workaround this you create a custom input behavior and handle the left key manually:
The behavior can be changed as follows:
Your Telerik Points have been updated for this report.
Should you have any other questions do not hesitate to ask.
Regards,
Dimitar
Telerik
Thank you for writing.
I was able to reproduce this issue and I have logged it in our Feedback Portal. You can track the item for status changes and add your vote for it here.
To workaround this you create a custom input behavior and handle the left key manually:
public
class
CustomInputBehavior : InputBehavior
{
public
CustomInputBehavior(DocumentView view) :
base
(view)
{
}
protected
override
bool
ProcessLeftKey(KeyEventArgs e)
{
RadDocument document =
this
.DocumentView.Document;
if
((Control.ModifierKeys & Keys.Control) == Keys.Control)
{
string
pos = document.CaretPosition.ToString();
int
posInWord = Convert.ToInt32(pos.Substring(pos.IndexOf(
'@'
) + 1, 1));
if
(posInWord > 0)
{
document.CaretPosition.MoveToCurrentWordStart();
}
else
{
document.CaretPosition.MoveToPreviousWordStart();
}
return
true
;
}
return
base
.ProcessLeftKey(e);
}
}
The behavior can be changed as follows:
this
.radRichTextBox1.DocumentView.InputBehavior =
new
CustomInputBehavior(
this
.radRichTextBox1.DocumentView);
Your Telerik Points have been updated for this report.
Should you have any other questions do not hesitate to ask.
Regards,
Dimitar
Telerik
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
0
Jason
Top achievements
Rank 1
answered on 21 Aug 2014, 12:37 AM
Thanks Dimitar.
I've updated the code to also handle the caret at the end of a word or at the end of a paragraph:
The solution works, but the Caret doesn't move immediately, as it does without the custom input behavior.
I've updated the code to also handle the caret at the end of a word or at the end of a paragraph:
if (posInWord > 0 || pos == "\" \"@0" || pos == "\"ΒΆ\"@0")
{
document.CaretPosition.MoveToCurrentWordStart();
}
The solution works, but the Caret doesn't move immediately, as it does without the custom input behavior.
0
Hi Jason,
Thank you for writing back.
Please note that this is just a workaround and in this case the functionality can be slower than normal. Nevertheless if you have any questions, please do not hesitate to contact us.
Regards,
Dimitar
Telerik
Thank you for writing back.
Please note that this is just a workaround and in this case the functionality can be slower than normal. Nevertheless if you have any questions, please do not hesitate to contact us.
Dimitar
Telerik
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.