Error: No spellcheck for this type of control.

2 posts, 0 answers
  1. redstar
    redstar avatar
    18 posts
    Member since:
    Feb 2011

    Posted 14 Apr 2011 Link to this post

    when check the TextBox, an error happen says:No spellcheck for this type of control.
    please help me.

    RadSpellChecker.Check(this.tbxMultiRow, SpellCheckingMode.AllAtOnce);
  2. Andrew
    Andrew avatar
    140 posts

    Posted 15 Apr 2011 Link to this post

    Hello redstar,

    RadSpellChecker internally holds a dictionary matching a Type to an instance of a class deriving from IControlSpellChecker. This dictionary is filled through MEF, as it searches the available assemblies for implementations of this interface marked with the [Export(typeof(IControlSpellChecker))] attribute, instantiates them and adds them to the dictionary mentioned above. The error message you got displays when MEF haven't loaded an IControlSpellChecker for your control. Which leads to two reasons for your exception:
    1) Your control is not supported by default (TextBox, RichTextBox and RadRichTextBox). In this case you have to supply an implementation of yours for IControlSpellChecker or SpellCheckerBase(an abstract class implementing IControlSpellChecker) and mark it with the export attribute above.
    2) You have enabled "Reduce XAP size by using application library caching" option in Project Properties(Silverlight tab). If this is the case then you have to register the corresponding IControlSpellChecker for the control you wish to use, by hand. You can use the following code before calling RadSpellChecker.Check method:

    ControlSpellCheckersManager.RegisterControlSpellChecker(new TextBoxSpellChecker());  
    IControlSpellChecker controlSpellchecker = ControlSpellCheckersManager.GetControlSpellChecker(typeof(TextBox));  
    ISpellChecker spellChecker = controlSpellchecker.SpellChecker;  
    DocumentSpellChecker documentSpellChecker = (DocumentSpellChecker)spellChecker;  
    documentSpellChecker.AddDictionary(new RadEn_USDictionary(), new System.Globalization.CultureInfo("en-US"));

    This is in case you want to spell check a TextBox with en-US culture. If you need to spell check other control please provide its implementation as argument to the ControlSpellCheckersManager.RegisterControlSpellChecker method. If you want to spell check a different culture replace the RadEn_USDictionary class with another one matching your preference.

    All the best,

    the Telerik team


    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 Public Issue Tracking system and vote to affect the priority of the items
  3. DevCraft banner
Back to Top