Needing to cast a DataGridView cell into a TextBoxBase

Posted on 2009-02-17
Last Modified: 2013-11-07
I don't know if it's even possible or if I'm even on the right track....but the quick background of this issue is that we have a third party spellchecker (Component1) and need to use it with the DataGridView.  What is required for the real time spell checker is that it be passed a byval TextBoxBase (which is called when the user enters the cell).  I'm still on the learning curve of .Net and have tried several things which I though would work (DataGridViewTextBoxCell, DataGridViewTextBoxEditingControl, DGV.EditingControl...etc) but can't seem to get the correct cast for a textboxbase.
Please let me know if more information is needed or if anything needs to be clarified.  And thanks in advance!!
Question by:chilekitty
    1 Comment

    Accepted Solution

    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

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
    Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now