Error deleting rows

Mar 18, 2009 at 8:15 PM
Edited Mar 19, 2009 at 12:49 AM
I have the new version 4.20 , when i delete a row i do not have any problem,  but when i close my windows form with the mouse i have a problem the message is the next:
Can not access the deleted object
Name of the object : 'DataGrid'

this happens when i delete a row and then i close the windows form

with the other versión 4.11 i do not have any problem

this is the method which is asociated to a column with a handler  in the DataGrid

Private Sub DeleteRow_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Dim grid As SourceGrid.DataGrid = CType(sender.Grid, SourceGrid.DataGrid) 
Dim rows() As Object = grid.SelectedDataRows

If Not rows Is Nothing And rows.Length > 0 Then
If grid.DeleteSelectedRows() Then 

End If
End If
End Sub

when i invoke the above method the row is deleted whitout any problem, but when i close the windows form i got an error message

if someone can help me please answer me thanks anyway

this is the error message:

Not  controled System.ObjectDisposedException
Message="Can not access the deleted object\r\nObject name: 'DataGrid'."
in System.Windows.Forms.Control.CreateHandle()
in System.Windows.Forms.Control.get_Handle()
in System.Windows.Forms.Control.PointToClientInternal(Point p)
in System.Windows.Forms.Control.PointToClient(Point p)
in SourceGrid.Cells.Controllers.MouseSelection.mScrollTimer_Tick(Object sender, EventArgs e)
in System.Windows.Forms.Timer.OnTick(EventArgs e)
in System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m)
in System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
in System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)

System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
in System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
in System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
in System.Windows.Forms.Application.Run(ApplicationContext context)
in Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
in Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
in Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
in SISTEMA.My.MyApplication.Main(String[] Args) en 17d14f5c-a337-4978-8281-53493378c1071.vb:línea 81
in System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
in System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
in Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
in System.Threading.ThreadHelper.ThreadStart_Context(Object state)
in System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
in System.Threading.ThreadHelper.ThreadStart()

Mar 20, 2009 at 5:58 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.