Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Bind calendar items to custom form (Read 4425 times)
Christiaan
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 6
Joined: Apr 23rd, 2015
Bind calendar items to custom form
Apr 28th, 2015 at 6:49pm
Print Post  
HI

What is the easiest way to bind non common fields to a custom appointment form.
I have added 2 fields to my custom appointment form, but can't seem to get them to bind when my user double click on the item.
I get all the fields linked to item class and appointment class. but would like to add custom1 and custom2 field.

here is my code for my form when user double click a item:
Appform.Subject = e.Item.HeaderText
            Appform.Description = e.Item.DescriptionText
            Appform.Date1 = e.Item.StartTime
            Appform.Date1T = e.Item.StartTime
            Appform.Date2 = e.Item.EndTime
            Appform.Date2T = e.Item.EndTime
            Appform.Chkalldaye = e.Item.AllDayEvent

Appform.ShowDialog()

I would like to add : appform.custom1 = e.item.department
                            appform.custom2 = e.item.shift



i am new with this, so any help would be appreciated
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Bind calendar items to custom form
Reply #1 - Apr 29th, 2015 at 7:40am
Print Post  
There should be no difference between assigning custom and regular item properties to the properties of your form. What exactly is the problem you are facing?

Regards,
Meppy
  
Back to top
 
IP Logged
 
Christiaan
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 6
Joined: Apr 23rd, 2015
Re: Bind calendar items to custom form
Reply #2 - Apr 29th, 2015 at 11:14am
Print Post  
Hi Meppy

Sorry for sounding dumb on this, but i get this error
Error      28      'Department' is not a member of 'MindFusion.Scheduling.Item'.      
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Bind calendar items to custom form
Reply #3 - Apr 29th, 2015 at 11:39am
Print Post  
You need to cast the item to your custom type. For example, if the custom item type is MyItem, you can do the following:

Code
Select All
Dim item As MyItem = CType(e.Item, MyItem) 


Then you can assign to the form properties:

Code
Select All
appform.custom1 = item.department
appform.custom2 = item.shift 


Regards,
Meppy
  
Back to top
 
IP Logged
 
Christiaan
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 6
Joined: Apr 23rd, 2015
Re: Bind calendar items to custom form
Reply #4 - Apr 30th, 2015 at 7:35am
Print Post  
Thank you Meppy!! Now I understand what I need to do
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint