Spell checking is not only used in word processors, text editors or other textual data entry controls. When adding lots of textual data to DataGrids for maintenance or doing calculations, a powerful spell checking concept can be very helpful as well.

Fresh from our labs, I would like to present some ideas how spell checking can be integrated into the .NET Framework DataGridView and related editing workflows.

Microsoft® Excel provides only a spell checking dialog to loop through the misspelled words. This is a very good way to check the whole spreadsheet when the user has finished the data entry. In word processing applications, users are familiarized with a live feedback of what they typed. This spell-as-you-type concept is a strong feature of TX Text Control and TX Spell .NET.

But how to use this concept in a DataGridView?

The Context Menu Approach

This sample illustrates a smart way of implementing live spelling with the powerful .NET spell checking component TX Spell .NET.

The following screenshot shows a DataGridView on a form. If a cell contains misspelled words, a little icon is displayed in the upper left corner of the cell.

TX Spell .NET in a DataGridView

When right-clicking a misspelled cell, a context menu is opened. The specialty of this context menu is that it shows all misspelled words of the current cell in a single menu. The context menu is not closed until the last misspelled word has been replaced or Close is clicked explicitly.

TX Spell .NET in a DataGridView

This gives you a very elegant way to replace all misspelled words in a cell with a single context menu. After a misspelled word has been replaced, it is displayed in green and strikethrough.

TX Spell .NET in a DataGridView

The Spell Check Dialog Approach

The second approach in this sample is a spell checking dialog that iterates through all cells in order suggest replacements for the misspelled words. This approach is comparable to the way how Microsoft implements spell checking in Excel.

TX Spell .NET in a DataGridView

The sample Visual Studio 2008 project requires at least a trial version of TX Spell .NET.

Download here: txspell_grid.zip

The above described methods are just ideas to integrate powerful spell checking into various processes. Using TX Spell .NET, you can add reliable spell checking to any control, workflow or application.