Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic ItemModifying event change (Read 3609 times)
tomk
YaBB Newbies
*
Offline


Yaos!

Posts: 29
Joined: Apr 25th, 2006
ItemModifying event change
Dec 6th, 2007 at 1:26pm
Print Post  

We are using 4.2.1.25421 version of the planner.  I am handling the ItemModifying event, setting the Confirm value to false if certain state conditions are not met.  However what occurs in newer versions of the Calendar differs from older ones.  I went back and tested this using a 3.2.x debug build and got my desired behavior, but in the more current version it is not working as we would like.

Here is an example.  Create an object deriving from appointment and add it to a Timetable view via the Schedule object.  In older versions of the Calendar, the ItemModifying event is handled before the start/end times are actually modified, so the drag or resize does not occur at all.  This is our expected and desired behavior.  However in 4.2x version, the Item does drag, but when the mouse is released it snaps back to its original place, e.g. it modifies the item then restores it.  The snap back is good and a neat effect but in our app we would prefer the older behavior, because we have certain business logic which fires based on start/end time modification (and makes expensive service calls), which we need to prevent based on state.  Thus we'd rather the item not drag/resize at all as in older versions.

Is there a combination of settings we have perhaps changed resulting in the snap-back, or is the behavior of the Tool update method indeed different from before, as it appears to be?  If the latter, would it be possible to add a setting?

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


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: ItemModifying event change
Reply #1 - Dec 6th, 2007 at 2:14pm
Print Post  
I recall we changed this behavior at some point because we felt like it would be better if item modification is handled this way. I don't think there is an option you can use at the moment in order to restore the previous behavior.

However, we will add a new setting (along with the one for the visible month weeks), which will enable to you use the previous item modification behavior.

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


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: ItemModifying event change
Reply #2 - Dec 10th, 2007 at 11:53am
Print Post  
Here is the most recent build of Planner.NET for .NET 1.1:

https://mindfusion.org/_planner/_Planner.NET_43_trial.zip

Now there is a new property DragNoModify (names suggestions are welcome) in the Calendar class with default value of true. Set this property to false in order to prevent items from moving over areas which do not accept items during drag operations.

Additionally, The TrailingWeekCount property of the MonthSettings class now accepts '-1' as a valid value. You can use this value to effectively decrease the number of visible weeks in the view by one.

Meppy
  
Back to top
 
IP Logged
 
tomk
YaBB Newbies
*
Offline


Yaos!

Posts: 29
Joined: Apr 25th, 2006
Re: ItemModifying event change
Reply #3 - Dec 10th, 2007 at 2:38pm
Print Post  

Thanks for the build.  We appreciate your taking the time to make these enhancements.  Like I said, the "snap back" effect on internal drag of items is cool but due to business logic we can't use it, and appreciate the ability to turn it off.

I have a few comments.  One, the name DragNoModify seems fine (well at least to me, since I asked for it I know what it is!), but the default behavior still seems to be the "snap back" or drag DOES modify.  Thus the value at present does not match the behavior.  When true, it does modify start/end times of Items so looks misleading.  Also should it belong on the item or timetable settings instead of calendar?  Next, the ability to set the Padding weeks to -1 works, but unfortunately we need to have the ability to have only 4 visible weeks in SingleMonth.  Thus we'd need to support -2 in fact, or use another mechanism.  Is that possible?

My only other concern is a breaking change to CustomDrawElements.  It looks like only the name values changed, but since we do a ton of custom drawing, including DayContents (now CellContents) I thought it'd be worth asking if there were any behind the scenes changes at all even though it looks like it hasn't changed too drastically, in fact just updated to match your move to ListView.

Regards
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: ItemModifying event change
Reply #4 - Dec 11th, 2007 at 8:11am
Print Post  
The default value of the DragNoModify property (as is customary) was chosen so that the behavior of the control does not change across versions.

The value of the TrailingWeekCount property can now be set to -2. Here is the updated version:

https://mindfusion.org/_planner/_Planner.NET_43_trial2.zip

The CustomDrawElements values have only been renamed in order to match the name of the new List view. Their behavior should be exactly the same.

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