RadSpellChecker on TextBox gives error no spell check for this type of control.

5 posts, 0 answers
  1. Stephen
    Stephen avatar
    43 posts
    Member since:
    Apr 2012

    Posted 28 Aug 2012 Link to this post

    I am using a simple textbox.  When I try to implement the RadSpellChecker on it, as in the examples, it gives me an error that there is no spell check for this type of control.

    I saw the older forum entry someone posted a while back, but my scenario is not the same.  I am using a basic standard textbox and I do not have 'Reduce XAP size..." enabled in my project.

    Here is my XAML Code:
    <TextBox x:Name="txtNotes" Width="520" Height="25" MaxLength="150" />

    And here is my C#:
    private void rbtnSpellCheck_Click(object sender, RoutedEventArgs e)
         RadSpellChecker.Check(txtNotes, SpellCheckingMode.WordByWord);

    See, pretty straight forward... hopefully the solution to whatever is causing me the issue is easy too :)
  2. Stephen
    Stephen avatar
    43 posts
    Member since:
    Apr 2012

    Posted 28 Aug 2012 Link to this post

    True to form I guess.  I work on this for a handful of hours.  Then I decide it is time to post the issue in the forums and then figure out the solution shortly after I decide to post it.

    Just in case anyone wants to know what else I had to do, here in the code that I added after InitializeComponent():

    ControlSpellCheckersManager.RegisterControlSpellChecker(new TextBoxSpellChecker());
    var _ControlSpellchecker = ControlSpellCheckersManager.GetControlSpellChecker(typeof(TextBox));
    var _SpellChecker = _ControlSpellchecker.SpellChecker;
    var _DocumentSpellChecker = (DocumentSpellChecker) _SpellChecker;
    _DocumentSpellChecker.SpellCheckingCulture = new CultureInfo("en-US");
    _DocumentSpellChecker.AddDictionary(new RadEn_USDictionary(), new CultureInfo("en-US"));

    Hopefully I did it right.
  3. DevCraft R3 2016 release webinar banner
  4. Andrew
    Andrew avatar
    140 posts

    Posted 30 Aug 2012 Link to this post

    Hello Stephen,

    We are glad you managed to solve your problem. Those ControlSpellCheckers are supposed to be loaded automatically through MEF. This is why when you use "Reduce XAP size..." or you inherit from TextBox class those spellcheckers are not loaded. 
    Apparently in your case something else is causing it. What the code you wrote does is just manually load the desired ControlSpellChecker.

    Just one more thing. If you want to use SpellCheckAllAtOnce window you have to register the RadRichTextBoxSpellChecker too, because no matter what control you spellcheck - it is the one used.

    All the best,
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  5. Vit100
    Vit100 avatar
    66 posts
    Member since:
    Oct 2012

    Posted 09 Nov 2012 Link to this post

    Let me add one more important point to Andrew's post:

    Don't forget to register  dictionary itself in control constructor/or somewhere
      RadCompositionInitializer.Catalog = new TypeCatalog( 

    Otherwise you will be able to spellcheck textBox, but no dictionary loaded, so everything is miss-spelled.
  6. Patrick
    Patrick avatar
    43 posts
    Member since:
    Jan 2013

    Posted 28 Feb 2013 Link to this post


    This worked great for us. Since we switched to using MEF our dictionary was always empty. Simply adding a new instance of TypeCatalog in our MainPage constructor did it without the need to manipulate the DocumentSpellChecker of our controls. Thank you.

Back to Top
DevCraft R3 2016 release webinar banner