7 Answers, 1 is accepted
If you refer to spell-check functionality of RadRichTextBox that we introduced in Q3, it actually works pretty straight-forward. You need to add RadRichTextBox and RadRichTextBoxRibbonUI controls on your Silverlight page which are located in the following assemblies:
Then you should add a reference to the assembly containing the English dictionary:
This is a new assembly added in Q3. RadRichTextBox will load the dictionary using MEF so you should not worry about any binding details.
The spell-checking feature is enabled by default. Thus RadRichTextBox will underline in red all errors found in the document. This feature can be toggled using the property:
Note: If you already have RadRichTextBoxRibbonUI added to your page and you do not want to reset it, you can add only the proofing tools with the designer context menu:
Result should look like in the demo app:
On the ribbon UI you have two buttons concerning spell-checking:
Enable Spell Check - this toggles the functionality using the same way as the property mentioned.
Find Next Error - this will search the document for spelling errors and position the context menu on the error to allow you correct the error, add it to the custom dictionary or ignore it:
This functionality can also be invoked through RadRichTextBox.OpenContextMenuOnNextSpellingError() method.
Let us know whether this helps.
the Telerik team
But if I want English to Spanish, how do I do?.
Currently SpellChecker works with RadDictionary, which can be created from .TDF files (the format used in Telerik ASP.NET RadSpell). You can use the es-ES dictionary from this forum post or create your own, following the steps, described here.
Then you need to create an instance of DocumentSpellChecker using that RadDictionary and assign your RadRichTextBox's SpellChecker property to it as described in our help section.
Let us know if you need further help.
the Telerik team
On this page
http://www.telerik.com/help/silverlight/radrichtextbox-features-spellcheck.html # Dictionaries
Private Sub CreateCustomDictionary ()
Dim dictionary As New RadIsolatedStorageCustomDictionary (IsolatedStorageScope.Site, "CustomDictionary.txt)
Dim As New DocumentSpellChecker spellchecker (dictionary)
Me.radRichTextBox.SpellChecker = spellchecker
LoadDictionary Private Sub (ByVal tdfFileStream As Stream)
Dim dictionary As New RadDictionary ()
CType (Me.radRichTextBox.SpellChecker, DocumentSpellChecker). AddDictionary (dictionary, New CultureInfo ("de-DE");}
In my project I put the language in this last example ("es-ES") but does not identify the tdf file, and I want to know if your example (Me.radRichTextBox ... is the bone RadRichTextBoxRibbonUI1 the edit.
The first snippet you posted is for creating IsolatedStorage dictionary.
The second snippet, however, has a missing line - the one which actually loads the stream into the instance of RadDictionary.
The code you need is:
There is a sample project (using an Italian dictionary and in C#) in this forum post. Note that currently we have an issue related to spelling errors highlighting, when another culture is use in the main Thread. This problem will be resolved with next internal build, thus for now you would need to register the new dictionary with the InvarianCulture, as specified in the demo. Look through it and let us know if you have any other questions.
the Telerik team
I am trying to add a custom dictionary to Rad Spell Check..
I created Test.txt file with few words and added to the project and loading to IsolatedStorage
IsolatedStorageFile isoStore = IsolatedStorageFile.GetUserStoreForApplication();
IsolatedStorageFileStream isoStream1 = new IsolatedStorageFileStream("Test.txt", FileMode.Create, isoStore);
Creating the Custom Dictionary..
RadIsolatedStorageCustomDictionary dictionary = new RadIsolatedStorageCustomDictionary(IsolatedStorageScope.Application, "Test.txt");
DocumentSpellChecker spellchecker = new DocumentSpellChecker(dictionary);
this._richTextBox.SpellChecker = spellchecker;
Stream tdfFileStream = Application.GetResourceStream(new Uri("/MC.Client.Controls;component/Resources/en-US.tdf", UriKind.RelativeOrAbsolute)).Stream;
RadDictionary dictionary1 = new RadDictionary();
its still showing the default dictionary and I did not find the words from Test.txt file.
Am I missing any thing.
Can you please post a sample working project which loads custom dictionary file like (ex: CustomDictionary.txt )
I am able to fix the issue.Its working fine now.