I am new to Telerik and am working on a project using RadScheduler. I am trying to find a way to force the user to choose a resource when creating or editing an appointment (set a default resource to be displayed in the dropdown and eliminate "-" as an option in the dropdown list, but still allow user to change resource). Any suggestions on how to accomplish this?
Thanks,
Dean
Thanks,
Dean
4 Answers, 1 is accepted
0
Hello Dean,
Here is an example how to do this:
Let us know if you have further questions.
Best wishes,
Peter
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
Here is an example how to do this:
| <ResourceTypes> |
| <telerik:ResourceType DataSourceID="SqlDataSource2" ForeignKeyField="RoomID" |
| KeyField="ID" Name="Rooms" TextField="RoomName" /> |
| </ResourceTypes> |
| 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) |
| { |
| Control c1 = (Control)e.Container.FindControl("_advancedControlsPanel"); |
| Control ResourceControlContainer = (Control)c1.FindControl("ResourceControls"); |
| DropDownList resourceDropDown = (DropDownList)ResourceControlContainer.FindControl("Rooms"); |
| resourceDropDown.Items.RemoveAt(0); |
| } |
| } |
Let us know if you have further questions.
Best wishes,
Peter
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
0
Dean
Top achievements
Rank 1
answered on 12 Mar 2008, 06:18 PM
Yes!! Works great! Thank you!
0
HHalim
Top achievements
Rank 2
answered on 29 May 2008, 05:07 PM
For the benefit of anyone else, I got an error from posted code above, so a small correction below.
Replace this line of code:
With this instead:
It really works now.
Replace this line of code:
| Control c1 = (Control)e.Container.FindControl("_advancedControlsPanel"); |
| Control c1 = (Control)e.Container.FindControl("AdvancedControlsPanel"); |
It really works now.
0
Hello Hart,
Thanks for mentioning this. What happened is that in an older version of RadScheduler, the controls in the advanced form were mispelled with one addition underscore "_" in front of their names. So, with later versions you are right that you need to reference the controls from code-behind using your suggestion.
Greetings,
Peter
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
Thanks for mentioning this. What happened is that in an older version of RadScheduler, the controls in the advanced form were mispelled with one addition underscore "_" in front of their names. So, with later versions you are right that you need to reference the controls from code-behind using your suggestion.
Greetings,
Peter
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center