This example demonstrates how to use the DevExpress Spell Checker component to check spelling in spreadsheet cells. When a user types text in a cell, the spell checker indicates misspelled words with a red wavy line. The user can right-click an underlined word and select the correct spelling from the list of suggestions or invoke the Spelling dialog.
This example uses the default English dictionary to check cell text. Refer to the following help topic for information on how to add dictionaries for other languages to the Spell Checker: Spell Checker Dictionaries.
Follow the steps below to integrate a spell checker into the Spreadsheet application:
-
Register the control used as the default cell editor (the System.Windows.Forms.TextBox descendant) to enable spell check in spreadsheet cells. See this topic for details: Check Spelling in Different Controls.
SpellCheckTextControllersManager.Default.RegisterClass(typeof(TextBoxWithTransparency), typeof(SimpleTextBoxTextController)); SpellCheckTextBoxBaseFinderManager.Default.RegisterClass(typeof(TextBoxWithTransparency), typeof(TextBoxFinder)); -
Handle the SpreadsheetControl.CellEditorOpened event to access the active cell editor. Use the SpellChecker.Check method to check text in the editor.
-
Create and display a Spell Check context menu for the cell editor, as described in this help topic: Add a Spell Check Menu to the Standard Text Controls.
(you will be redirected to DevExpress.com to submit your response)
