Force/refresh spell check?

5 posts, 0 answers
  1. Kjell
    Kjell avatar
    275 posts
    Member since:
    Jun 2010

    Posted 02 Jan 2014 Link to this post

    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;
                    }


  2. Petya
    Admin
    Petya avatar
    975 posts

    Posted 07 Jan 2014 Link to this post

    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 >>
  3. DevCraft banner
  4. Kjell
    Kjell avatar
    275 posts
    Member since:
    Jun 2010

    Posted 17 Jan 2014 Link to this post

    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. 
  5. Petya
    Admin
    Petya avatar
    975 posts

    Posted 20 Jan 2014 Link to this post

    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 >>
  6. Kjell
    Kjell avatar
    275 posts
    Member since:
    Jun 2010

    Posted 20 Jan 2014 Link to this post

    Ah, that's very helpful, thank you.
Back to Top
DevCraft banner