C1 Community
ComponentOne Community is a free source for developers and help authors to collaborate and communicate.

Using C1SpellChecker with DataGridView in VB.Net

rated by 0 users
This post has 2 Replies | 2 Followers

Not Ranked
Posts 7
chilekitty Posted: Tue, Feb 17 2009 2:31 PM

How can I get real time spell checking (no dialog checking) in a DataGridView cell using the C1SpellChecker? 

Currently I am using the SpellGrid sample and have replaced the C1FlexGrid with the DataGridView.  I'm pretty new to .Net and have tried several things but just can't seem to get the correct cast to a textboxbase which the SetSpellChecking requires. Thanks in advance!
Not Ranked
Posts 7

Found out what the issue was...wouldn't you know it, just when I finished entering this question. I'm including the code snippet in case anyone has the same problem I did:

Private Sub _flex_EditingControlShowing(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewEditingControlShowingEventArgs) Handles _flex.EditingControlShowing

Dim tb As TextBoxBase = TryCast(e.Control, TextBoxBase)

  If tb IsNot Nothing Then

    _spell.SetSpellChecking(tb, True)

  End If

End Sub

Top 10 Contributor
Posts 2,707

Thanks for sharing the solution!

Page 1 of 1 (3 items) | RSS
Contact ComponentOne: 1.800.858.2739 ©1987-2010 ComponentOne LLC All Rights Reserved.