This is a migrated thread and some comments may be shown as answers.

Create Appoint via code with dynamic Resources

1 Answer 76 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
luke
Top achievements
Rank 1
luke asked on 22 Jun 2011, 05:33 AM
Hi

I can add an appointment via code to the scheduleview. When i add dynamic Resopurces though, i can't figure out how to assign them when the new object is created. As yiou can see I have had a crack at a few things, but to no avail. Any help would be much appreciated.

Thanks

Dim appointment As IAppointment = Me.RadScheduleView1.CreateNew()
       appointment.Start = DateTime.Now
       appointment.End = DateTime.Now.AddHours(1)
       appointment.Subject = "New appointment"
       'appointment.Resources(1) = "Tom"
       'appointment.Resources(0) = "Room 102"
       'Dim a As New ResourceCollection
       'a = appointment.Resources
       'appointment.Resources.Add(New Resource("Speaker", "Tom"))
       'appointment.Resources.Add(New Resource("Room", "Room 102"))
       'Dim a As New Telerik.Windows.Controls.Resource
       'a.ResourceType = "Room"
       'Dim b As New Telerik.Windows.Controls.Resource
       'b.ResourceType = "Speaker"
       'appointment.Resources(0) = b.
       'appointment.Resources(1) = a
         
       Me.RadScheduleView1.Commit()

1 Answer, 1 is accepted

Sort by
0
luke
Top achievements
Rank 1
answered on 22 Jun 2011, 06:42 AM
I just worked it out

in case any one else gets stuck here is the code i used

'MyData the name of my data class where resources dynamically created
        Dim b As New MyData
        'ResourcesTypes(0) first dynamic resource
        '.Resources(1) a value in that resource
        appointment.Resources.Add(b.ResourcesTypes(0).Resources(1))
        appointment.Resources.Add(b.ResourcesTypes(1).Resources(1))
Tags
ScheduleView
Asked by
luke
Top achievements
Rank 1
Answers by
luke
Top achievements
Rank 1
Share this question
or