This is a migrated thread and some comments may be shown as answers.

Using WPF SpellChecker in Winform App

1 Answer 123 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Patrick
Top achievements
Rank 2
Patrick asked on 30 Aug 2012, 03:01 PM
Due to some limitations and issues with the Winform version of RadSpellChecker I started investigating using the WPF version instead through an ElementHost. 
I discovered that I didn't need the ElementHost and that I could get the WPF RadSpellChecker to take my text and "pop up" by doing the following:
  • Added Reference to "Telerik.Windows.Documents.Proofing"
  • Added Using of "Telerik.Windows.Controls"
  • Created WPF Textbox like so --> var txtControl = new System.Windows.Controls.TextBox();
  • Assigned some test text to it --> txtControl.Text = "This isn't speelt rite.";
  • Ran the static Check() method --> RadSpellChecker.Check(txtControl, SpellCheckingMode.AllAtOnce);

This almost works, I get the SpellCheck window with my text in it but there aren't any words in the dictionary.  Because of the way I'm doing it would I need to add the base English Dictionary back in?  Am I making some other rookie mistake?  Attached is an image of what I am seeing and below is the simple code snippet in it's entirety.

var txtControl=new System.Windows.Controls.TextBox();
txtControl.Text="This isn't speelt rite.";
RadSpellChecker.Check(txtControl, SpellCheckingMode.AllAtOnce);


P.S. I didn't know if this belonged in the Winform or WPF forum, sorry.

1 Answer, 1 is accepted

Sort by
0
Accepted
Iva Toteva
Telerik team
answered on 03 Sep 2012, 03:19 PM
Hi Patrick,

The dictionaries that RadSpellChecker uses are separated from the implementation of the control. An En-US dictionary is distributed with RadControls for WPF, but it is in a different assembly than the spell checker and you should add a reference to the Telerik.Windows.Documents.Proofing.Dictionaries.En-US assembly.

You can read more about multi-language support and loading dictionaries for spell checking here.

Kind regards,
Iva Toteva
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
General Discussions
Asked by
Patrick
Top achievements
Rank 2
Answers by
Iva Toteva
Telerik team
Share this question
or