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
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