Issue with spell check in RAD Editor

6 posts, 0 answers
  1. abhay
    abhay avatar
    9 posts
    Member since:
    Jan 2009

    Posted 10 Dec 2010 Link to this post

    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

  2. Iva Toteva
    Iva Toteva avatar
    1319 posts

    Posted 10 Dec 2010 Link to this post

    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,
    the Telerik team
    Browse the videos here>> to help you get started with RadControls for Silverlight
  3. Bobby Jones
    Bobby Jones avatar
    2 posts
    Member since:
    Nov 2009

    Posted 19 Jan 2011 Link to this post

    How much of a footprint does the SL spell checker use in the XAP file?
  4. Boby
    Boby avatar
    763 posts

    Posted 21 Jan 2011 Link to this post

    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,
    the Telerik team
    Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
  5. Paul
    Paul avatar
    7 posts
    Member since:
    Mar 2011

    Posted 08 May 2012 Link to this post

    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.


  6. Andrew
    Andrew avatar
    140 posts

    Posted 11 May 2012 Link to this post

    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.

    the Telerik team

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

Back to Top