[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
   Getting Started
  [Expand]Grid View
  [Expand]Tree List
  [Expand]Card View
  [Expand]Chart Control
  [Expand]Pivot Grid
  [Collapse]Rich Text Editor
   [Expand]Product Information
    Getting Started
     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: Implement the Format Painter functionality
     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]Site Navigation and Layout
  [Expand]HTML Editor
  [Expand]Vertical Grid
  [Expand]Data Editors
  [Expand]Docking and Popups
  [Expand]File Management
  [Expand]Data and Image Navigation
  [Expand]Multi-Use Site Controls
  [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]Office File API
[Expand]Report and Dashboard Server
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

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++)

Is this topic helpful?​​​​​​​