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

Spell Checker : Gets stuck in the word contains special characters

1 Answer 62 Views
SpellChecker
This is a migrated thread and some comments may be shown as answers.
Anand
Top achievements
Rank 1
Anand asked on 03 Jun 2015, 03:32 PM

Hi all, 

I am facing few issues in command  OpenContextMenuOnNextSpellingErrorCommand. I use this command to find the next word that is spelled wrongly in the document. It works fine as long as the words in the document doesnt contain special characters and keeps finding the next error word in the document. But once if it finds the words contain the special character like (RevPAR), Luto'n or Test$word, it stops finding for the next word in the document and gets stuck.

Is there any way I can fix this please ? We are using telerik version 2014.3.1021.40.

Thanks

A

 

1 Answer, 1 is accepted

Sort by
0
Svetoslav
Telerik team
answered on 04 Jun 2015, 02:09 PM
Hi Anand,

Thank you for contacting us.

This is is known and already logged in our feedback portal where you can track its state: "Go to next word does not treat punctuation marks as separate words". The problem is with the GoToNextWord() method  which doesn't work as expected in this case.

As a I would suggest you to use the following code snippet:
private DocumentPosition caretPostion;
 
private void OpenContextMenuOnNextSpellingErrorCommand(object sender, RoutedEventArgs e)
{
    RadRichTextBox rtb = this.radRichTextBox;
 
    if (this.caretPostion == null)
    {
        this.caretPostion = rtb.Document.CaretPosition;
    }
 
    this.radRichTextBox.Commands.OpenContextMenuOnNextSpellingErrorCommand.Execute();
 
    var currentCaretPostion = rtb.Document.CaretPosition;
 
    if (currentCaretPostion == this.caretPostion)
    {
        rtb.Document.CaretPosition.MoveToNextInline();
        this.caretPostion = rtb.Document.CaretPosition;
    }
}

I hope this information is helpful. Let me know if you need further assistance.
  
Regards,
Svetoslav
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
SpellChecker
Asked by
Anand
Top achievements
Rank 1
Answers by
Svetoslav
Telerik team
Share this question
or