The following is for version 3.6 of RapidSpell Desktop, if you are using v3.7 up please refer to this article instead. To use RapidSpellAsYouType with XtraGrid it's necessary to add the following classes to your project, and then to set the ColumnEdit property for each Column to the new editor type AYTTextEdit (which derives from the regular DevExpress text editor). Most work can actually be done through the designer. The attachments are designed for RapidSpell Desktop .NET v3.6.0.100 and DevExpress XtraGrid 6.1.5.0 - if you have new versions please see the "3rd party DLLs" directory with RapidSpell to see if a new version of Keyoti.RapidSpell.DevExpressSupport is included, or contact support@keyoti.com A complete C# project is available here A complete VB.NET project is available here Step by step instructions 1. Add references to Keyoti.RapidSpell.DevExpressSupport.v6.1.dll, Keyoti.RapidSpell.dll and Keyoti.RapidSpellMDict.dll to your project. 2. Include RepositoryItemAYTTextEdit.cs or RepositoryItemAYTTextEdit.vb in your project. 3. If necessary add a GridControl to the form, and set the DataSource. 4. Compile project - this is necessary to ensure that the ColumnEdit property includes the new spell checker editor type in the designer. 5. Add DevExpress_Grid.RepositoryItemAYTTextEdit.InitRapidSpellAsYouType() to Form constructor, after InitializeComponent() call - this creates the spell checker and configures it. For XtraGrid, it is necessary to have one static instance of the spell checker. 6. Add this line Keyoti.RapidSpell.RapidSpellChecker, Keyoti.RapidSpell to existing licenses.licx file in the project. 7. Add a ContextMenu control to the form, this will be used to disable the default XtraGrid context-menu in the text editor. At present this is necessary, otherwise the DevExpress CM will override the spell checker's. 8. Open the property editor and set the ColumnEdit property (under Columns)
9. Under "In-place Editor Repository" set repositoryItemAYTTextEdit.ContextMenu to ContextMenu1 10. Close the designer and run the project! By design an 'e' is shown in the top right in cells which have spelling errors, and a straight underline is used to highlight errors. These can be modified in the classes which were added in the RepositoryItemAYTTextEdit file. NOTE: If you do not wish to use the designer, the same effect as the above can be done using this code: RepositoryItemAYTTextEdit texteditor = new RepositoryItemAYTTextEdit(); texteditor.ContextMenu=new ContextMenu(); gridControl1.RepositoryItems.Add(texteditor); gridView1.Columns[0].ColumnEdit = texteditor; gridView1.Columns[1].ColumnEdit = texteditor; which should be placed in the constructor of the form. If you have any questions please email support@keyoti.com |