How to set Appointment.Resources

4 posts, 1 answers
  1. Saykor
    Saykor avatar
    70 posts
    Member since:
    Feb 2011

    Posted 01 Jul 2014 Link to this post

    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
  2. Saykor
    Saykor avatar
    70 posts
    Member since:
    Feb 2011

    Posted 01 Jul 2014 Link to this post

    A little more information.
    I use MVVM and control version 2013.2.611.45
  3. UI for WPF is Visual Studio 2017 Ready
  4. Answer
    Kalin
    Admin
    Kalin avatar
    1207 posts

    Posted 02 Jul 2014 Link to this post

    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.
     
  5. Saykor
    Saykor avatar
    70 posts
    Member since:
    Feb 2011

    Posted 02 Jul 2014 Link to this post

    Thank you it works
Back to Top