Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / October 2004

Tip: Looking for answers? Try searching our database.

Cannot access a disposed object name "DataGridTextBox"

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jevelson - 12 Oct 2004 21:09 GMT
HI,

I am have attached DataGrid to DataSets.

When I try to hit delete key, and then closing form gives me following error
message

Cannot access a disposed object name "DataGridTextBox"
Object name "DataGridTextBox" .

Details
--------------------------------------------------------------------
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.ObjectDisposedException: Cannot access a disposed object named
"DataGridTextBox".
Object name: "DataGridTextBox".
  at System.Windows.Forms.Control.CreateHandle()
  at System.Windows.Forms.TextBoxBase.CreateHandle()
  at System.Windows.Forms.Control.get_Handle()
  at System.Windows.Forms.TextBox.GetLength()
  at System.Windows.Forms.TextBoxBase.set_SelectionStart(Int32 value)
  at System.Windows.Forms.TextBox.SelectInternal(Int32 start, Int32 length)
  at System.Windows.Forms.TextBoxBase.SelectAll()
  at
System.Windows.Forms.DataGridTextBox.set_IsInEditOrNavigateMode(Boolean value)
  at System.Windows.Forms.DataGridTextBoxColumn.EndEdit()
  at System.Windows.Forms.DataGridTextBoxColumn.Commit(CurrencyManager
dataSource, Int32 rowNum)
  at System.Windows.Forms.DataGrid.CommitEdit()
  at System.Windows.Forms.DataGrid.EndEdit()
  at System.Windows.Forms.DataGrid.OnLeave_Grid()
  at System.Windows.Forms.Control.InvokeMarshaledCallbacks()

I appreciate you help.

Thanks,
Jevelson
mklapp - 14 Oct 2004 14:07 GMT
Just guesses without seeing code:

This happens when you close the form, right?  In my programs, I check the
dataset attached to the grid to check for changes when the Close (or
isCLosing or whatever) event fires.  

Could you be explicitly disposing of the grid before performing this check?  
I do not think you need to call grid.dispose.  If not, then you may have
control event handlers doing more than is safe to do when they are fired.

Just guesses.

> HI,
>
[quoted text clipped - 36 lines]
> Thanks,
> Jevelson

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.