Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 10 Replies) Item Created (Read 6073 times)
SimonL
YaBB Newbies
*
Offline



Posts: 36
Joined: Aug 11th, 2006
Item Created
Oct 17th, 2006 at 8:35am
Print Post  

1. Item created event not always firing
2. After the code has run it leaves a ghost image which is actually longer in duration to the real item created.

The following code is in the item_creating and item_created event.

       ' Booking can only start on the boundray of a day, no time element
       e.Item.StartTime = e.Item.StartTime - TimeSpan.FromHours(e.Item.StartTime.Hour)
       e.Item.StartTime = e.Item.StartTime - TimeSpan.FromMinutes(e.Item.StartTime.Minute)
       e.Item.StartTime = e.Item.StartTime - TimeSpan.FromSeconds(e.Item.StartTime.Second)

       ' Booking can only end on the boundray of a day, no time element
       e.Item.EndTime = e.Item.EndTime - TimeSpan.FromHours(e.Item.EndTime.Hour)
       e.Item.EndTime = e.Item.EndTime - TimeSpan.FromMinutes(e.Item.EndTime.Minute)
       e.Item.EndTime = e.Item.EndTime - TimeSpan.FromSeconds(e.Item.EndTime.Second)

       ' Booking must be at least one day
       If e.Item.EndTime - e.Item.StartTime < TimeSpan.FromDays(1) Then
           e.Item.EndTime = e.Item.StartTime + TimeSpan.FromDays(1)
       End If


Version:4.1 beta

Regrads,
Simon

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


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Item Created
Reply #1 - Oct 17th, 2006 at 11:52am
Print Post  
I am not sure whether I understand the problem you are facing. What do you mean by 'ghost image'? Can you also describe the scenario when the ItemCreated event is not fired?

Thank you,
Meppy

P.S.: Instead of subtracting hours, minutes and seconds from the time in order to get the date, you can simply use the DateTime.Date property.
  
Back to top
 
IP Logged
 
SimonL
YaBB Newbies
*
Offline



Posts: 36
Joined: Aug 11th, 2006
Re: Item Created
Reply #2 - Oct 18th, 2006 at 7:30am
Print Post  
The item_created is not always being fired when I use the mouse to drag out a new item.

Ghost image that gets left behind is just a dark shadow of where the item was.

Regards,
Simon

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


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Item Created
Reply #3 - Oct 18th, 2006 at 7:47am
Print Post  
I'm testing here and the control is working fine. Are you sure you have set Calendar.EnableDragCreate to true? The ghost image that appears might be the selection you draw while dragging the mouse when EnableDragCreate is set to false.

If the property is already true, is it possible to send me the initialization code of the control in your application, so that I can test here with exactly the same configuration?

Meppy
  
Back to top
 
IP Logged
 
SimonL
YaBB Newbies
*
Offline



Posts: 36
Joined: Aug 11th, 2006
Re: Item Created
Reply #4 - Oct 18th, 2006 at 9:26am
Print Post  
Here's the initialization code

[code]
       Me.BookingsView.AllowInplaceEdit = False
       Me.BookingsView.CurrentView = MindFusion.Scheduling.WinForms.CalendarView.ResourceView
       Me.BookingsView.Date = New Date(2006, 10, 6, 0, 0, 0, 0)
       Me.BookingsView.DateTimeFormat = CType(resources.GetObject("BookingsView.DateTimeFormat"), System.Globalization.DateTimeFormatInfo)
       Me.BookingsView.Dock = System.Windows.Forms.DockStyle.Fill
       Me.BookingsView.EnableDragCreate = True
       Me.BookingsView.EndDate = New Date(2006, 11, 5, 0, 0, 0, 0)
       Me.BookingsView.GroupType = MindFusion.Scheduling.WinForms.GroupType.GroupByLocations
       Me.BookingsView.Location = New System.Drawing.Point(0, 0)
       Me.BookingsView.Name = "BookingsView"
       Me.BookingsView.ResourceViewSettings.ExpandableRows = MindFusion.Scheduling.WinForms.State.Disabled
       Me.BookingsView.ResourceViewSettings.MiddleTimelineSettings.Format = "MMMM yyyy"
       Me.BookingsView.ResourceViewSettings.RowHeaderSize = 200
       Me.BookingsView.ResourceViewSettings.ShowPaddingDates = MindFusion.Scheduling.WinForms.State.Disabled
       Me.BookingsView.ResourceViewSettings.Timelines = 2
       Me.BookingsView.ResourceViewSettings.ViewStyle = MindFusion.Scheduling.WinForms.ResourceViewStyle.Lanes
       Me.BookingsView.ShowToolTips = True
       Me.BookingsView.Size = New System.Drawing.Size(836, 474)
       Me.BookingsView.TabIndex = 0
       Me.BookingsView.Theme = MindFusion.Scheduling.WinForms.ThemeType.Windows2003
[/code]
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Item Created
Reply #5 - Oct 18th, 2006 at 10:24am
Print Post  
I still don't have any luck in reproducing your problem. I have created a new application using the initialization code you supplied (it seems however that you have omitted the creation of the Location objects) but the ItemCreated event is fired and the control in general is working fine. I will appreciate it if you send me your project along with a short description of what to do in order to reproduce the bug to support@mindfusion.org.

Thank you,
Meppy
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Item Created
Reply #6 - Oct 19th, 2006 at 11:39am
Print Post  
I received your e-mail but there was nothing attached to it. Can you please send me the application you were talking about in the e-mail so that I can reproduce the bug here?

Thank you,
Meppy
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Item Created
Reply #7 - Oct 20th, 2006 at 5:49am
Print Post  
Here is a fixed version:

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

The ItemCreated event should now be fired for all items. As for some items not being created, make sure you are not trying to create them on an earlier date than the current date, because there is a condition in ItemCreating which prevents items from being created in the past.

Meppy
  
Back to top
 
IP Logged
 
SimonL
YaBB Newbies
*
Offline



Posts: 36
Joined: Aug 11th, 2006
Re: Item Created
Reply #8 - Oct 20th, 2006 at 6:28am
Print Post  
Excellent, Thanks meppy the event is firing ever time now, thanks again.

Regards,
Simon
  
Back to top
 
IP Logged
 
Milo
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 29
Joined: Jul 16th, 2007
Re: Item Created
Reply #9 - Jul 24th, 2007 at 6:46am
Print Post  
Hey guys,

I seem to be getting the same error, ItemCreating isn't getting fire but ItemModifing is if I drag an item..

What was the fix for this, the download seems to be a 404.

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


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Item Created
Reply #10 - Jul 24th, 2007 at 7:25am
Print Post  
The bug should be fixed in the most recent release. You can download it from here:

https://mindfusion.eu/PlannerTrial.zip

Also, this event is only fired when an item is created interactively by the user and not when the item is added programmatically.

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