Hi:
I have a drop down populated with a list of values on the advanced form. Depending on the value chosen in the drop down I want to be able to set the description and the end time to a certain value. How can I achieve this ? In the .net world I would have done it in the selected index changed event of the drop down but with the rad scheduler I dont know how can I create such an event.
Thanks,
Aditya
15 Answers, 1 is accepted
0
Hello Aditya ,
I recommend you use the advanced templates approach for this case:
http://demos.telerik.com/aspnet-ajax/scheduler/examples/advancedformtemplate/defaultcs.aspx
In the ResourceControl user control you can easily hook to the selectedIndexChanged event of the dropdownlist.
Let us know if you have further questions.
Kind regards,
Peter
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
I recommend you use the advanced templates approach for this case:
http://demos.telerik.com/aspnet-ajax/scheduler/examples/advancedformtemplate/defaultcs.aspx
In the ResourceControl user control you can easily hook to the selectedIndexChanged event of the dropdownlist.
Let us know if you have further questions.
Kind regards,
Peter
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Aditya
Top achievements
Rank 1
answered on 16 Jul 2009, 02:06 PM
Is there anyway out without using the advanced templates ? I have pretty much all the functionality working except for this functionality. I would hate to redo things all over again to achieve this.
Thanks,
Aditya
Thanks,
Aditya
0
Hello Aditya ,
Suppose you have a resource type with Name="Students". Then you can try the following:
Is this what you need?
Greetings,
Peter
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Suppose you have a resource type with Name="Students". Then you can try the following:
| protected void RadScheduler1_FormCreated(object sender, Telerik.Web.UI.SchedulerFormCreatedEventArgs e) |
| { |
| if (e.Container.Mode == Telerik.Web.UI.SchedulerFormMode.AdvancedEdit || e.Container.Mode == Telerik.Web.UI.SchedulerFormMode.AdvancedInsert) |
| { |
| Session["CurrentAppointmentID"] = e.Appointment.ID; |
| RadComboBox studentsCB = e.Container.FindControl("ResStudents") as RadComboBox; |
| studentsCB.BackColor = System.Drawing.Color.Red; |
| studentsCB.SelectedIndexChanged += new RadComboBoxSelectedIndexChangedEventHandler(studentsCB_SelectedIndexChanged); |
| studentsCB.AutoPostBack = true; |
| } |
| } |
| void studentsCB_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e) |
| { |
| Appointment currentapp = RadScheduler1.Appointments.FindByID(Session["CurrentAppointmentID"]); |
| Appointment appToUpdate = currentapp; |
| appToUpdate.Subject = "modified"; |
| foreach (Resource res in RadScheduler1.Resources.GetResourcesByType("Students")) |
| { |
| if (e.Text == res.Text) |
| appToUpdate.Resources.Add(res); |
| } |
| RadScheduler1.UpdateAppointment(appToUpdate, currentapp); |
| RadScheduler1.ShowAdvancedEditForm(currentapp); |
| } |
Is this what you need?
Greetings,
Peter
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Aditya
Top achievements
Rank 1
answered on 16 Jul 2009, 09:47 PM
My resource name is patients so I replaced Students by the name Patients. It compiled fine but when I try to run it the following things happen
RadComboBox patientsCB = e.Container.FindControl("ResPatients") as RadComboBox;
on this line patientsCB is null and hence it gives a Object not set to instance of an object exception when it tries to execute the following
patientsCB.SelectedIndexChanged += new RadComboBoxSelectedIndexChangedEventHandler(patientsCB_SelectedIndexChanged);
Thanks,
Aditya
0
Sorry, I forgot to mention that with older versions, the resources are displayed using DropDownList instead of RadCombobox. Could this be the case? If you still experience problems, please, isolate the issue in a simple working project and send it to us via a support ticket.
Cheers,
Peter
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Aditya
Top achievements
Rank 1
answered on 17 Jul 2009, 11:04 AM
Its kind tough to build a working version of the project. Here is what I am doing
I have 4 items in the resource collection namely Resources,Type,Patients and Status. However when I do a e.Appointment. only Resources shows up in the intellisense. I am assuming because it treats Resources as a collection. This statement returns a value of 1 e.Appointment.Resources.Count and when I do a ResourceCollection val = e.Appointment.Resources; val contains only Resources. It almost seems as if the resource collection does not know that the other items exist ?
Hope this helps,
Aditya
0
Hello Aditya ,
How exactly do you define your resource types?
Peter
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
How exactly do you define your resource types?
Peter
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Aditya
Top achievements
Rank 1
answered on 17 Jul 2009, 01:57 PM
So basically I have four resources(Resources,Type,Status and Patients). When I click the forward arrow to configure the scheduler the resource collection option shows up. I add these items to the resource collection.
Aditya
Aditya
0
That seems fine. You probably have done the steps from this help article:
http://www.telerik.com/help/aspnet-ajax/schedule_designcustomresourcesandattributes.html
So now can you specify what exactly the problem is that you experience?
Peter
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Aditya
Top achievements
Rank 1
answered on 17 Jul 2009, 02:37 PM
So that is exactly how I have defined my resources. Now as suggested by you when I try to do the following
the patientsCB is null on Line 1 and the application errors on Line 2 with an Object reference not set to an instance of an object exception.
Thanks,
Aditya
| Line 1:RadComboBox patientsCB = e.Container.FindControl("ResPatients") as RadComboBox; |
| Line 2: patientsCB .SelectedIndexChanged += new RadComboBoxSelectedIndexChangedEventHandler(patientsCB _SelectedIndexChanged); |
| Line 3: patientsCB .AutoPostBack = true; |
the patientsCB is null on Line 1 and the application errors on Line 2 with an Object reference not set to an instance of an object exception.
Thanks,
Aditya
0
Please, make sure this code is the FormCreated handler and you have the following check:
| if (e.Container.Mode == Telerik.Web.UI.SchedulerFormMode.AdvancedEdit || e.Container.Mode == Telerik.Web.UI.SchedulerFormMode.AdvancedInsert) |
Peter
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Aditya
Top achievements
Rank 1
answered on 17 Jul 2009, 03:22 PM
I am already doing that check before trying to find the control.
Aditya
Aditya
0
Well, the only way to help you then is that you isolate the problem in a simple working project and send it to us for testing via a support ticket.
Peter
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Aditya
Top achievements
Rank 1
answered on 22 Jul 2009, 03:54 PM
Peter,
I tried to create a support ticket and send the aspx pages across in zipped format but when I checked the status of the ticket it said it was closed by the Telerik staff.
Aditya
I tried to create a support ticket and send the aspx pages across in zipped format but when I checked the status of the ticket it said it was closed by the Telerik staff.
Aditya
0
Hello Aditya ,
Please, excuse me about this. I have mistakenly assumed that you have filed a duplicate forum and ticket posts on the same problem. I will go ahead now and reopen your ticket, but probably I will be able to investigate it no earlier than tomorrow.
Kind regards,
Peter
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Please, excuse me about this. I have mistakenly assumed that you have filed a duplicate forum and ticket posts on the same problem. I will go ahead now and reopen your ticket, but probably I will be able to investigate it no earlier than tomorrow.
Kind regards,
Peter
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.