Skip to content

Use the Spell Checker component to check spelling in spreadsheet cells.

License

Notifications You must be signed in to change notification settings

DevExpress-Examples/wpf-spreadsheet-spell-check-cell-text

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spreadsheet for WPF – Spell Check Text in a Cell Editor

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.

Spreadsheet - Spell Checking

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.

Implementation Details

Follow the steps below to integrate a spell checker into the Spreadsheet application:

  1. Configure the Spreadsheet control’s DXSpellChecker behavior in XAML:

    <dxsps:SpreadsheetControl>
         <mvvm:Interaction.Behaviors>
                <local:SpreadsheetSpellChecker 
                    CheckAsYouType="True" 
                    ShowSpellCheckMenu="True" 
                    Culture="en-US" />
         </mvvm:Interaction.Behaviors>
    </dxsps:SpreadsheetControl>
  2. Call the SpellingSettings.RegisterTextControl method to enable spell check for the control used as the default cell editor (the System.Windows.Controls.TextBox descendant). See this topic for details: Register Custom Control to Enable Spell Checking.

    SpellingSettings.RegisterTextControl(typeof(XpfCellInplaceEditor));
    
  3. Handle the SpreadsheetControl.CellEditorOpened event to access the active cell editor. Use the SpellChecker.Check method to check text in the editor.

  4. Handle the SpellChecker.CheckCompleteFormShowing event to suppress the appearance of this dialog box: Spell check is complete.

Files to Look At

More Examples

Does this example address your development requirements/objectives?

(you will be redirected to DevExpress.com to submit your response)