Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic ResetDrag results in ThreadException (Read 2060 times)
tomk
YaBB Newbies
*
Offline


Yaos!

Posts: 29
Joined: Apr 25th, 2006
ResetDrag results in ThreadException
May 10th, 2006 at 5:43pm
Print Post  

I have a situation where certain user edits to a Schedule Item (timetable view) must be confirmed or cancelled.  For example, a user can highlight an Item on the grid and drag its lower boundary down to increase the length (by changing the EndTime on the item).  In certain cases this must be confirm/cancelled.

If the dialog result is cancel, I found I got into a loop because the Calendar was still tracking the mouse. The Calendar continued to fire its Update event which in turn changed the value via the EndTime set accessor on the Item.  After various attempts to remove the item from focus and/or selection I have stumbled on the handy ResetDrag() method in the Calendar.

Using this, in a "cancel edit" situation the EndTime accessor is only called once and I get the behavior I need, but it throws an exception.  It appears that it is still trying to execute a callback or something but that gets a null exception after I have called ResetDrag().  Is there anything I have to clean up before calling that method?

Here is the error.  It occurs immediately after the code execution is complete in my Form which cancels the mouse-driven edit to the Item:

"System.NullReferenceException: Object reference not set to an instance of an object.\r\n   at MindFusion.Scheduling.WinForms.Calendar.OnMouseMove(MouseEventArgs e)\r\n   at System.Windows.Forms.Control.WmMouseMove(Message& m)\r\n   at System.Windows.Forms.Control.WndProc(Message& m)\r\n   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)\r\n   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)\r\n   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)"

Thanks again
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: ResetDrag results in ThreadException
Reply #1 - May 11th, 2006 at 8:13am
Print Post  
It seems rather difficult to reproduce this situation here. Can you send me the source code that causes the exception, so that I can test it at my side? The e-mail address is: support@mindfusion.org. Thank you.

Meppy
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint