Log In
[Expand]General Information
[Expand]WinForms Controls
[Collapse]ASP.NET Controls and MVC Extensions
 [Expand]What's Installed
 [Expand]Common Concepts
 [Collapse]ASP.NET WebForms Controls
  [Expand]Chart Control
  [Expand]Grid View
  [Expand]Card View
  [Expand]Vertical Grid
  [Collapse]Rich Text Editor
   [Expand]Product Information
     How to: Change the Mail Merge data sources at runtime
     How to: Define the default page settings such as margins, paper kind, landscape etc
     How to: Get a selected text on the client side
     How to: Insert RTF text to a document
     How to: Insert text to the end of the document on the client side
     How to: Merge several documents content into a single document
     How to: Open a document using drag-and-drop
     How to: Open SpellChecker dialog via Ribbon
     How to: Save and load documents from a database
     How to: Save words added via the Add to Dictionary option to a custom physical dictionary
     How to: Upload a document in the working directory using drag-and-drop
  [Expand]Image and Data Browsing
  [Expand]Docking and Popups
  [Expand]Site Navigation and Layout
  [Expand]File Management
  [Expand]Multi-Use Site Controls
  [Expand]HTML Editor
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Data Editors
  [Expand]Spell Checker
  [Expand]Query Builder
 [Expand]ASP.NET MVC Extensions
 [Expand]Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Report Server
[Expand]eXpressApp Framework
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

How to: Save words added via the Add to Dictionary option to a custom physical dictionary

Show Me

A complete sample project is available in the DevExpress Code Examples database at http://www.devexpress.com/example=T467655.

Currently, ASPxRichEdit doesn't save words added by a user via the "Add to Dictionary" option in the physical dictionary file and stores these changes in a Session variable.

If it's necessary to save changes from the temporary dictionary stored in Session to a physical dictionary file on demand, you can accomplish this task programmatically, for example, on a button click. Get the temporary dictionary that has the SpellCheckerCachedCustomDictionary type from Session in the following way:

SpellCheckerCachedCustomDictionary dic = Session[ASPxRichEdit1.Settings.SpellChecker.Dictionaries[0].CacheKey] as SpellCheckerCachedCustomDictionary;
Note that you need to pass an index of your custom dictionary to the collection of other dictionaries used in your project as the Dictionaries collection index in this code.

Then, pass words from that temporary dictionary to a new instance of your custom dictionary class derived from SpellCheckerCustomDictionary and save this custom dictionary to the appropriate physical path obtained from the temporary dictionary's DictionaryPath property:

MyCustomDictionary dictionary = new MyCustomDictionary();
for (int i = 0; i < dic.WordCount; i++)

How would you rate this topic?​​​​​​​