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

Force/refresh spell check?

4 Answers 81 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Kjell
Top achievements
Rank 1
Kjell asked on 03 Jan 2014, 03:56 AM
I've implemented the ability for the user to switch dictionaries on the fly.  This works fine except it doesn't re-check the existing text, it only works for new text.  How can I force the Spellchecker to run again for the existing text?

This is how I am setting it:

//bind dictionary
                switch (id)
                {
                    case 1:
                        richBox.SpellChecker = myDictionaries.SpellcheckerAux;
                        break;
                    case 2:
                        richBox.SpellChecker = myDictionaries.SpellcheckerAux2;
                        break;
                    default:
                        richBox.SpellChecker = myDictionaries.Spellchecker;
                        break;
                }


4 Answers, 1 is accepted

Sort by
0
Petya
Telerik team
answered on 07 Jan 2014, 04:43 PM
Hi,

Could you please open a support ticket and send us your project, so that we can investigate the cause of the behavior?

Additionally, maybe you could simply switch the spellchecking culture and not the whole SpellChecker of the editor like follows:
RadDictionary dictionary = new RadDictionary();
dictionary.Load(tdfFileStream);
((DocumentSpellChecker)this.radRichTextBox.SpellChecker).AddDictionary(dictionary, new CultureInfo("de-DE"));
 
this.radRichTextBox.SpellChecker.SpellCheckingCulture = new CultureInfo("de-DE");

This seems to work fine on our end and it checks the words that were previously added to the control as well.

We're looking forward to hearing from you.

Regards,
Petya
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Kjell
Top achievements
Rank 1
answered on 17 Jan 2014, 09:16 PM
I'm currently adding custom words using the 'Spellchecker.AddWord' method, if I define all my dictionaries in one spell checker, then how do I keep the custom words separate?  When the user adds a word, I want it to go only in the active dictionary. 
0
Petya
Telerik team
answered on 20 Jan 2014, 12:42 PM
Hi,

Thanks for getting back to us!

Actually, the DocumentSpellChecker class can hold multiple custom dictionaries based on their respective culture. Additionally, when multiple custom dictionaries are present adding a word will include it only to the dictionary corresponding to the current spellchecking culture. What you can do is create the dictionary as follows:
((DocumentSpellChecker)this.radRichTextBox.SpellChecker).AddDictionary(dictionary, new CultureInfo("de-DE"));
((DocumentSpellChecker)this.radRichTextBox.SpellChecker).AddCustomDictionary(new RadIsolatedStorageCustomDictionary(), new CultureInfo("de-DE"));

I hope this helps!

Regards,
Petya
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Kjell
Top achievements
Rank 1
answered on 20 Jan 2014, 03:04 PM
Ah, that's very helpful, thank you.
Tags
RichTextBox
Asked by
Kjell
Top achievements
Rank 1
Answers by
Petya
Telerik team
Kjell
Top achievements
Rank 1
Share this question
or