Change behavior of 'Add to dictionary' option

2 posts, 0 answers
  1. Paul
    Paul avatar
    30 posts
    Member since:
    Mar 2011

    Posted 11 Mar 2014 Link to this post

    The rad editors on a site have users able to add custom words to the dictionary. The client however, wants to change it. They see that the users add terms that are unnecessary or incorrect terms being used. What they want is for them to approve of the terms before adding them to the custom dictionary. Is there a way to modify the behavior of the 'Add to Dictionary' option of a misspelled word to not add it to the custom dictionary and instead submit that entry into a database to wait to be approved?
  2. Marin Bratanov
    Marin Bratanov avatar
    3907 posts

    Posted 14 Mar 2014 Link to this post

    Hi Paul,

    Generally, this is not supported, because the spellchecking logic is quite complex and the suggestions dropdown is created for each new word, so it is very difficult to override it.

    What I can offer is overriding the internal method that adds a word, so you can call your own custom logic instead of having the built-in spellcheck add to the dictionary. Note that blocking the thread execution would be quite hard in this case, so further user actions would be difficult to add.

    Here is a the simplest way I could do this, which will give you a handle to submit the word for review with your own code (e.g., a webservice call. This blog post may give you ideas on the way to send this information to the server:
    <telerik:RadEditor ID="RadEditor1" runat="server" OnClientCommandExecuted="knowIfSpellCheck">
    <script type="text/javascript">
        function knowIfSpellCheck(sender, args)
            if(args.get_commandName() == "AjaxSpellCheck")
                setTimeout(function ()
                    Telerik.Web.UI.Editor.AjaxSpellCheck.prototype.addCustomWord = addCustomWordNew;
                }, 100);
        function customAddWord(word)
            //save the word to the DB as desired
        function addCustomWordNew(oWord)
            var spell = this.getSpellService();
            var oSpellEngine = this._spellEngine;
            var oSuccess = this._addWordSuccessMessage;
            oSpellEngine.clearWrongWords(oWord, oWord);
            var res = oSpellEngine.isHighlightedRemaining();
            if (!res)

    I hope this helps. You can further customize this to match your needs if you like.

    Marin Bratanov

    DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.

Back to Top