Christopher Krause

Christopher Krause

  • NA
  • 24
  • 57.8k

From our labs: New spell checking concepts for DataGridViews

Jan 24 2012 10:45 AM

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.


About TX Text Control:

TX Text Control was originally released in 1991, since then more than 50,000 copies have been sold. Starting off as a single, small DLL, TX Text Control has made its way through 16-bit DLL and VBX versions to today's Enterprise edition with its .NET and ActiveX components. The recent addition to the family, TX Text Control .NET Server, offers all of TX Text Control advanced word processing functionality in an easy-to-use server-side .NET component. Customers benefit from these years of experience, large user base, and at the same time, appreciate developing with a mature, reliable product.

Contact Informations:

[email protected]

North & South America:
Phone: +1 704-370-0110
Phone: +1 877-462-4772 (toll free)

Europe:
Phone: +49 (0)421 42 70 67 10

Asia Pacific:
Phone: +886 2-2797-8508

Answers (1)