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

Issue with spell check in RAD Editor

5 Answers 215 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
abhay
Top achievements
Rank 1
abhay asked on 10 Dec 2010, 06:30 AM
Hi,
 
I tried to improve the download size of XAP by changing project properties to "Reduce XAP size by using application library caching". Issue comes when we run the application it shows red underline (like spell check does) under every word. It may be because the dictionary is not getting loaded or something. Can you help

Regards\
Abhay

5 Answers, 1 is accepted

Sort by
0
Iva Toteva
Telerik team
answered on 10 Dec 2010, 10:13 AM
Hi Abhay,
All additional UI components (dialogs, context menu, selection mini toolbar) and dictionaries are normally instantiated by MEF. If application library caching is turned on, when MEF tries to find types they are in the assemblies still on the server, thus they cannot be loaded. Thus the dialogs will not show and spell checker will underline every word.
As a workaround, you can manually create and set instance of the dictionary like this:
((DocumentSpellChecker)this.richTextBox.SpellChecker).AddDictionary(new RadEn_USDictionary(), CultureInfo.InvariantCulture);
somewhere after InitializeComponents call in your constructor, for example in a handler of RadRichTextBox's Loaded event.
This is what you need to get all dialogs working and the dictionary :
// Next method calls are required only to work around limitations for using MEF with library caching
this.editor.FindReplaceDialog = new FindReplaceDialog();
this.editor.ParagraphPropertiesDialog = new RadParagraphPropertiesDialog();
this.editor.FontPropertiesDialog = new FontPropertiesDialog();
 
this.editor.InsertSymbolWindow = new RadInsertSymbolDialog();
this.editor.InsertHyperlinkDialog = new RadInsertHyperlinkDialog();
 
this.editor.ContextMenu = new ContextMenu();
this.editor.SelectionMiniToolBar = new SelectionMiniToolBar();
 
this.editor.InsertTableDialog = new InsertTableDialog();
this.editor.TablePropertiesDialog = new TablePropertiesDialog();
this.editor.TableBordersDialog = new TableBordersDialog();
 
this.editor.SpellCheckingDialog = new SpellCheckingDialog();
((DocumentSpellChecker)this.editor.SpellChecker).AddDictionary(new RadEn_USDictionary(), CultureInfo.InvariantCulture);

Don't hesitate to contact us if you have other questions.


All the best,
Boby
the Telerik team
Browse the videos here>> to help you get started with RadControls for Silverlight
0
Bobby Jones
Top achievements
Rank 1
answered on 19 Jan 2011, 10:57 PM
How much of a footprint does the SL spell checker use in the XAP file?
0
Boby
Telerik team
answered on 21 Jan 2011, 05:30 PM
Hello Bobby,
The assembly containing the default En-Us dictionary is about 900 KB when compressed in the XAP file. You could also prepare assemblies containing your own custom dictionaries, as described here.

Don't hesitate to contact us if you have other questions.

All the best,
Boby
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
Paul
Top achievements
Rank 1
answered on 08 May 2012, 02:18 PM
I'm using the following: 

 

 

this.txtDescription.SpellCheckingDialog = new SpellCheckingDialog();

 

((

 

DocumentSpellChecker)this.txtDescription.SpellChecker).AddDictionary(new RadEn_USDictionary(), CultureInfo.InvariantCulture);

This does not recognize "wouldn't" until I add it.  Now i have read that it does not immediately recognize contractions - not on the copy paste I get that one.  

Iissue one:  I would like add some of the common contractions to the dictionary as well as industry specific words.  The issue is if I add them will all my users see those changes or is all the users have independant copies of the dictionary somewhere?

Issue two:
How do I find this dictionary and can it be edited directly or do I have to create a UI for it?  I simply could just put all of my words into my application and individually add them but would all of my users see these changes or would be restricted to me?
I see people referencing a TDF file but I can find it no where - is this what I should create and how would that work because I'm assuming I want to inherit the base dictionary content. 

Could I use the MSFT word dictionary?  And how?

This silverlight app is being hosted in SPS2010 if that makes a difference.
Paul

 

0
Andrew
Telerik team
answered on 11 May 2012, 12:44 PM
Hi Paul,

RadRichTextBox uses .tdf files for storing the words for a given language and creating RadDictionary instances. For the time being no other formats than .tdf can be used. You can find a lot of available .tdf dictionaries here. You can read how to create dictionaries different from the one included in our suite here.

In your case it would be best to edit the default en-US.tdf file and create a class inheriting from RadDictionary which loads the edited .tdf file. Thus all your clients will be using it and the words you have added will be used on every client. 

On the other hand, you can't edit the dictionary you have loaded when your application is running. RadRichTextBox uses Custom dictionaries when a user wants a specific word to not be considered erroneous. These added words are included in the isolated storage by default.

The word "wouldn't" is already added in the en-US.tdf file so you don't have to do that.

Greetings,
Andrew
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
RichTextBox
Asked by
abhay
Top achievements
Rank 1
Answers by
Iva Toteva
Telerik team
Bobby Jones
Top achievements
Rank 1
Boby
Telerik team
Paul
Top achievements
Rank 1
Andrew
Telerik team
Share this question
or