aspnetcore-401928-rich-edit-spell-check.md
The RichEdit control allows you to use third-party tools to implement spell check. Use the client spellCheck option or the server SpellCheck(Action<SpellCheckBuilder>) method (for .NET Core) to specify the following settings:
| Client Property | .NET Core Server Method | Description |
|---|---|---|
| enabled | Enabled(Boolean) | Specifies whether the spell check is enabled. |
| checkWordSpelling | CheckWordSpelling(String) | A function that checks a word. |
| suggestionCount | SuggestionCount(Int32) | The maximum number of suggested words that can be displayed in the context menu. |
| addWordToDictionary | AddWordToDictionary(String) | A function that is called when a user clicks the Add to Dictionary context menu command. |
The isEnabled property allows you to enable and disable spell check at runtime:
richEdit.spellCheckerOptions.isEnabled = false;
Tip
If your application is built on the Angular framework, refer to following section for instructions on how to implement spell check in the RichEdit: Angular Application - Spell Check.
The RichEdit npm package includes a webpack configuration file that allows you to compile the nspell library and dictionaries into a package bundle. The configuration file references the English dictionary.
Follow the steps below to compile the bundle.
Run the following commands within the project’s root directory:
Add the import directive for every additional dictionary to the node_modules/devexpress-richedit/bin/nspell-index.js file.
Register additional dictionaries with a corresponding “lang” attribute prior to the default English dictionary to use them first while spell checking.
Run the following command that builds an nspell bundle according to the node_modules/devexpress-richedit/bin/nspell.webpack.config.js configuration file:
Create the spell-checker-worker.js file with the following content:
Place the nspell.js and spell-checker-worker.js files into the directory that contains the control scripts ( wwwroot for .NET Core, Scripts for MVC and Web Forms).
For an application on a client framework, add the following code to the page that contains the RichEdit control: