RadSpellCheck - Dictionary Location?

4 posts, 0 answers
  1. Arthur Colman
    Arthur Colman avatar
    5 posts
    Member since:
    Dec 2006

    Posted 02 Sep 2011 Link to this post

    How is a dictionary loaded into the RadSpellChecker (UI product)?

    I'm working with the beta of the RichTextBox and I have been able to integrate it along with the RadRibbonUI control that you have provided (by the way quite nice, thanks). It was able to figure out that the SpellChecker associated with the RichTextBox is separate from the SpellChecker used to correct the spelling errors. I have been able to load a .tdf file from the web product into the RichTextBox.SpellChecker and only misspelled words are flagged in the RichTextBox and in the SpellChecker UI.

    I can even add words to the dictionary and the additions are retained across uses of the program, so I know that my additions are being stored somewhere. But where?

    Just to be clear. I do know how to load a dictionary into the DocumentSpellChecker that is associated with the RichTextBox but I do not know how to load a dictionary into the RadSpellChecker nor do I know where updates made via RadSpellChecker are stored.

    Thanks for your help.


  2. Svett
    Admin
    Svett avatar
    728 posts

    Posted 07 Sep 2011 Link to this post

    Hi Arthur Colman,

    New words are added to custom separated dictionary stored in the application isolated storage file system. You can access it by using the following code snippet:

    using (IsolatedStorageFileStream fileStream = new IsolatedStorageFileStream("CustomDictionary.txt", FileMode.Open, IsolatedStorageScope.Application))
    {
       using (StreamReader reader = new StreamReader(fileStream))
       {
          string word;
          while ((word = reader.ReadLine()) != null)
          {
              if (word != string.Empty)
              {
     
              }
          }
       }
    }

    Best wishes,
    Svett
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

  3. UI for WinForms is Visual Studio 2017 Ready
  4. kapil
    kapil avatar
    1 posts
    Member since:
    Nov 2010

    Posted 22 Feb 2013 Link to this post

    how to add words in to dictionary programmatically?


  5. Svett
    Admin
    Svett avatar
    728 posts

    Posted 26 Feb 2013 Link to this post

    Hello Kapil,

    You should use the code snippet below:
    RadSpellChecker spellCheker = new RadSpellChecker();
    Type yourTextControlType = typeof(RadTextBox);
    IControlSpellChecker controlSpellChecker = spellCheker.GetControlSpellChecker(yourTextControlType);
    controlSpellChecker.SpellChecker.AddWord("yourWord");

    Note that you should initialize yourTextControlType variable with the text control type that you want to spell check.

    All the best,
    Svett
    the Telerik team
    Q3'12 SP1 of RadControls for WinForms is out now. See what's new.
Back to Top