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

[Solved] Editing Appointment

1 Answer 116 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Chinnu Prabhakar
Top achievements
Rank 1
Chinnu Prabhakar asked on 01 Oct 2009, 07:00 AM
Hi,
     I'm using a radscheduler which is same as the following demo
http://www.telerik.com/help/aspnet-ajax/schedule_databindingimplementingaproviderthatsupportsmultivaluedresources.html

instead of using teacher and student , i'm using room and users

users are listed in checkbox which is populated from the usercontrol  MultipleValuesResourceControl.ascx

in this MultipleValuesResourceControl.ascx  i'm checking the resouceavailability  which is in this demo with slide modification

http://demos.telerik.com/aspnet-ajax/scheduler/examples/resourceavailability/defaultcs.aspx

here is the code

private IEnumerable<Resource> GetResources(string resType)
        {
            List<Resource> availableUsers = new List<Resource>(Owner.Resources.GetResourcesByType("User"));
            List<Resource> availableResources = new List<Resource>();
            IEnumerable<Resource> resources = Owner.Resources.GetResourcesByType(resType);
            
                foreach (Appointment appointmentInRange in Owner.Appointments.GetAppointmentsInRange(Appointment.Start, Appointment.End))
                {
                    if (appointmentInRange == Appointment)
                        continue;

                    foreach (Resource occupiedUser in appointmentInRange.Resources.GetResourcesByType("User"))
                    {
                        availableUsers.Remove(occupiedUser);
                    }
                    if (availableUsers.Count == 0)
                    {
                        found = true;
                    }
                }         
           
                //foreach (Resource res in resources)
                //{
                //    if (IncludeResource(res))
                //    {
                //        availableResources.Add(res);
                //    }
                //}

                //return availableResources;
           
            return availableUsers;
        }

the commented code was the original one, but i did mofication to check the available resources

while editing an appointment which is reoccuring i'm having some pblm, otherwise its working good

while editing the reoccuring appointment  ie "EDIT ONLY THIS OCCURENCE"  it shows error "Object reference cannot set to an instance".

if anyone has any idea plz help



1 Answer, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 05 Oct 2009, 01:53 PM
Hello Chinnu,

We will need a demo project to be able to determine the cause of the problem. Can you open a support ticket or upload a sample somewhere and send us a link to download it?


Best wishes,
Peter
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Scheduler
Asked by
Chinnu Prabhakar
Top achievements
Rank 1
Answers by
Peter
Telerik team
Share this question
or