Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Moving Appointments in ResourceView (Read 2662 times)
GL@Olympus
YaBB Newbies
*
Offline


Too much work, too little
time, no doughnuts

Posts: 12
Joined: Jun 18th, 2011
Moving Appointments in ResourceView
Jul 8th, 2011 at 2:49pm
Print Post  
Hi Guys,

A silly one I am sure but for the life of me I cannot see how to do this...

We are displaying appointments in ResourceView grouped by Contact and I have set ItemChangeReferenceKey = 'None' to allow the users to drag an existing appointment and drop it onto another contact and/or another date.

All is well but I cannot see how to get the contact where the user has dropped the appointment. I can get the old one by handling ItemModified and using ItemModifiedEventArgs OldResources.Item(0).Name, but how to get the new contact so I can associate it with the appointment and then use it later to store the change back to our DB?

I am sure I am missing something but it is Friday, I am tired, the deadline fast approaches and I need to resolve this ???

Thanks in advance for (I am sure) another speedy response!

Graham
  

If a man states a fact in the woods when there are no women present, is he still wrong?
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Moving Appointments in ResourceView
Reply #1 - Jul 8th, 2011 at 2:56pm
Print Post  
At the time the ItemModified event is raised, the item is already associated with the new contact. Therefore you can check its Items.Contacts collection to obtain a reference to the new contact.

Let me know if this helps.

Regards,
Meppy
  
Back to top
 
IP Logged
 
GL@Olympus
YaBB Newbies
*
Offline


Too much work, too little
time, no doughnuts

Posts: 12
Joined: Jun 18th, 2011
Re: Moving Appointments in ResourceView
Reply #2 - Jul 8th, 2011 at 3:08pm
Print Post  
Hey Meppy,

Embarrassed

You know, I'm sure I tried this and got an "Object Reference Not Set" exception so I went about looking for other ways, finally finding this just after posting the message:

Dim rect As Rectangle = c1.GetItemBounds(e.Item)
Dim con As Contact = c1.GetContactAt(rect.X + 5, rect.Y + 5)
e.Item.Contacts.Add(con)

but having tried your suggestion again, blow me, it works !

Thanks again.

Graham
  

If a man states a fact in the woods when there are no women present, is he still wrong?
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint