Writing RadDictionary back to .tdf when words are added?

5 posts, 0 answers
  1. Kjell
    Kjell avatar
    283 posts
    Member since:
    Jun 2010

    Posted 12 Apr 2012 Link to this post

    I have several dictionaries stored outside of the XAP file and I load the approriate one manually.   I did this in order to minimize the size of the xap.

    To load the dictionary, I use the 'WebClient()' class and do the following in OpenReadCompletedEventHandler
    System.IO.Stream st = e.Result;
    dictionary = new RadDictionary();
    ((DocumentSpellChecker)this.txtDesc.SpellChecker).AddDictionary(dictionary, CultureInfo.CurrentCulture);

    The dictionary is loading properly, however adding to the dictionary only works for the session, which makes sense.  So my question is, how do I sync the .tdf file when the user selects "Add to dictionary".  I am able to capture the "DataChanged" event, so I guess in that event handler I just need to pass the dictionary ( or even better just the word) to my webservice and overwrite the existing .tdf.  How do I do that?

    Also I realize this means all users will be editing the same .tdf, and that is not ideal, but right now it doesn't work at all and I just want to get it working.  I am still on the latest SL4 build.
  2. Andrew
    Andrew avatar
    140 posts

    Posted 17 Apr 2012 Link to this post

    Hi Kjell,

    DocumentSpelChecker uses custom dictionaries when you click the add or remove buttons. These custom dictionaries use isolated storage by default. You can alter the logic of those buttons the way you described, but we would recommend implementing the IWordDictionary interface instead. We have a class named RadIsolatedStorageCustomDictionary. You can download the source code for our controls and locate the file. You can alter the logic we have implemented to write to a file on the server instead in the IsolatedStorage and then using this class would cause everyone to use a common dictionary.
    Please consider that approach and get back to us if you need additional assistance.

    Kind regards,
    the Telerik team

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

  3. Kjell
    Kjell avatar
    283 posts
    Member since:
    Jun 2010

    Posted 17 Apr 2012 Link to this post

    Oops, I posted this in the wrong forum.. Should be in the SL forum, I'll create a new thread there, please delete this.
  4. Desh
    Desh avatar
    6 posts
    Member since:
    Aug 2011

    Posted 14 Jul 2017 in reply to Andrew Link to this post

    Where can we find the source code of the controls as mentioned by you?
  5. Tanya
    Tanya avatar
    626 posts

    Posted 19 Jul 2017 Link to this post

    Hello Desh,

    The source code of the controls could be found in your telerik.com account, under the Downloads section. Have in mind that it is distributed only with a developer license. Please, check the Download Product Files topic for more information on how to access the files.

    Hope this is helpful.

    Progress Telerik
    Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Back to Top