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

How to set Appointment.Resources

3 Answers 166 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Saykor
Top achievements
Rank 2
Saykor asked on 01 Jul 2014, 01:22 PM
Hello,
I try to follow this demo: http://demos.telerik.com/silverlight/#ScheduleView/Grouping/GroupingAndFiltering
But not to load the appointments from xml. I try to build them from our system:

public ObservableCollection<Appointment> Appointments { get; set; }

Appointments = Context.Messages.Where(x => x.IsTask).Select(x => new Appointment()
            {
                Body = x.Text,
                Start = x.StartDate,
                End = DbFunctions.AddMinutes(x.StartDate, 20).Value,
                Resources = new ResourceCollection()
                {
                    new Resource(x.Sender.UserName, "User")
                }
            }).ToObservableCollection();

How I can do this when Resources not have a setter ?

Best regards,
Saykor

3 Answers, 1 is accepted

Sort by
0
Saykor
Top achievements
Rank 2
answered on 01 Jul 2014, 01:22 PM
A little more information.
I use MVVM and control version 2013.2.611.45
0
Accepted
Kalin
Telerik team
answered on 02 Jul 2014, 09:09 AM
Hello Saykor,

You would need to firstly create the Appointment and then assign the required resources by adding them to its Resources collection as shown below:

var app = new Appointment { Start = DateTime.Now, End = DateTime.Now.AddHours(1), Subject = "App1" };
app.Resources.Add(new Resource("Resource 1", "Resource 1"));

Hope this helps.

Regards,
Kalin
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
0
Saykor
Top achievements
Rank 2
answered on 02 Jul 2014, 12:52 PM
Thank you it works
Tags
ScheduleView
Asked by
Saykor
Top achievements
Rank 2
Answers by
Saykor
Top achievements
Rank 2
Kalin
Telerik team
Share this question
or