Solved

cannot access a disposed object named datagridtextbox

Posted on 2007-11-16
6
223 Views
Last Modified: 2010-04-23
When I click on the datagrid on my form in the text areas it will navigate but if I click on the grey area next to it I get the message cannot access a disposed object named datagridtextbox.  Can someone tell me why it will not navigate when you click on the grey area of the row.

It appears that is pt does not have a value when I click the grey area next to the line.
        Dim pt = New Point(e.X, e.Y)

        Dim hti As DataGrid.HitTestInfo = DataGrid2.HitTest(pt)

        If hti.Type = DataGrid.HitTestType.Cell Then


thanks
0
Comment
Question by:running32
  • 3
  • 3
6 Comments
 
LVL 96

Expert Comment

by:Bob Learned
Comment Utility
Is 'hit' Nothing when you click on the grey area?

Bob
0
 

Author Comment

by:running32
Comment Utility
Good morning Bob,

Yes, when I step through hti is  = Nothing and pt is = Nothing when pt = {System.drawing.point} and hti = pt = {System.Windows.Forms.Datagrid.HitTestInfo}
0
 
LVL 96

Accepted Solution

by:
Bob Learned earned 500 total points
Comment Utility
Try something like this then.

Bob


Dim pt = New Point(e.X, e.Y)

Dim hti As DataGrid.HitTestInfo = DataGrid2.HitTest(pt)

If hti IsNot Nothing AndAlso hti.Type = DataGrid.HitTestType.Cell Then

End If

Open in new window

0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 

Author Comment

by:running32
Comment Utility
I still need it to read the line that is clicked.  Does vb.net not reconize the line that is clicked inside the datagrid unless it is in the white area?  Thanks
0
 
LVL 96

Expert Comment

by:Bob Learned
Comment Utility
I haven't used the DataGrid in a long time, but my first inclination is you need to click on the DataGrid where it responds as expected.

Bob
0
 

Author Comment

by:running32
Comment Utility
Thank you for the help.  I have it working now.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

772 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

11 Experts available now in Live!

Get 1:1 Help Now