I use RadScheduler in my application...created resource collection and populated with some data.....but in the drop down by default the first list item is dispalyed as '-' which I dont want. Because if we insert appointment by selecting '-' in the resource type, null value is inserted into the database in that particular cell. So, please let me know how to delete that '-' from the list items.
Thanks
46 Answers, 1 is accepted
This behavior is by design. If no resource of a specific type is associated with the appointment, the "-" option is selected for the dropdown list. You can use Templates to change the default behavior. If you specify what exactly should happen in the case when no resource of a certain type is associated with the appointment, we will provide with a solution.
Kind regards,
Peter
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center

Thank you for the reply.
In that case, if the user dont select any resource and clicks submit, then a message should be displayed saying that "Please select...."(its like requiredfield validator) and also the appointment insertion should be cancelled.
Regards
Thanks for clarifying. You can try the following solution:
<telerik:RadScheduler ID="RadScheduler1" runat="server" |
OnAppointmentInsert="RadScheduler1_AppointmentInsert" |
OnAppointmentUpdate="RadScheduler1_AppointmentUpdate"> |
<ResourceTypes> |
<telerik:ResourceType DataSourceID="SqlDataSource2" ForeignKeyField="UserID" KeyField="ID" |
Name="Users" TextField="UserName" /> |
</ResourceTypes> |
</telerik:RadScheduler> |
protected void RadScheduler1_AppointmentInsert(object sender, Telerik.Web.UI.SchedulerCancelEventArgs e) |
{ |
if (e.Appointment.Resources.GetResourceByType("Users") == null) |
{ |
Response.Write("Please, select a user."); |
e.Cancel = true; |
} |
} |
protected void RadScheduler1_AppointmentUpdate(object sender, Telerik.Web.UI.AppointmentUpdateEventArgs e) |
{ |
if (e.ModifiedAppointment.Resources.GetResourceByType("Users") == null) |
{ |
Response.Write("Please, select a user."); |
e.Cancel = true; |
} |
} |
All the best,
Peter
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center

Thank you for ur support....its working(ofcourse if we write response.write(), its throwing error, so replaced with msgBox()).
I also want to know whether we can insert radiobuttons or textboxes in that appointment filling form(may be in the resource collection or may be outside the resource collection in the RadScheduler)
Here is an example. Please, consider the Database Scheduler Provider example and try the following code with it:
<AdvancedEditTemplate> |
<asp:TextBox ID="TitleTextBox" Rows="5" Columns="20" runat="server" Text='<%# Bind("Subject") %>' |
Width="95%" TextMode="MultiLine"></asp:TextBox> |
<div style="position: relative"> |
<span>Teachers:</span><br /> |
<asp:CheckBoxList ID="TeachersCheckBoxList" runat="server"> |
</asp:CheckBoxList> |
</div> |
<br /> |
<br /> |
<div> |
<span>Students:</span><br /> |
<asp:CheckBoxList ID="StudentsCheckBoxList" runat="server"> |
</asp:CheckBoxList> |
</div> |
<asp:LinkButton ID="UpdateButton" runat="server" Text="Update" CommandName="Update" /> |
</AdvancedEditTemplate> |
protected void RadScheduler1_FormCreated(object sender, SchedulerFormCreatedEventArgs e) |
{ |
CheckBoxList teachers = (CheckBoxList)e.Container.FindControl("TeachersCheckBoxList"); |
foreach (Resource r in RadScheduler1.Resources.GetResourcesByType("Teacher")) |
{ |
ListItem listitem1 = new ListItem(r.Text, r.Key.ToString()); |
listitem1.Selected = ResourceIsInUse(r, e.Appointment); |
teachers.Items.Add(listitem1); |
} |
CheckBoxList students = (CheckBoxList)e.Container.FindControl("StudentsCheckBoxList"); |
foreach (Resource r in RadScheduler1.Resources.GetResourcesByType("Student")) |
{ |
ListItem listitem1 = new ListItem(r.Text, r.Key.ToString()); |
listitem1.Selected = ResourceIsInUse(r, e.Appointment); |
students.Items.Add(listitem1); |
} |
} |
private bool ResourceIsInUse(Resource res, Appointment a) |
{ |
foreach (Resource appRes in a.Resources) |
{ |
if (res == appRes) |
{ |
return true; |
} |
} |
return false; |
} |
protected void RadScheduler1_AppointmentCommand(object sender, AppointmentCommandEventArgs e) |
{ |
CheckBoxList teachers = (CheckBoxList)e.Container.FindControl("TeachersCheckBoxList"); |
CheckBoxList students = (CheckBoxList)e.Container.FindControl("StudentsCheckBoxList"); |
e.Container.Appointment.Resources.Clear(); |
foreach (ListItem item1 in teachers.Items) |
{ |
if (item1.Selected) |
{ |
Resource teacher = RadScheduler1.Resources.GetResource("Teacher", int.Parse(item1.Value)); |
e.Container.Appointment.Resources.Add(teacher); |
} |
} |
foreach (ListItem item1 in students.Items) |
{ |
if (item1.Selected) |
{ |
Resource student = RadScheduler1.Resources.GetResource("Student", int.Parse(item1.Value)); |
e.Container.Appointment.Resources.Add(student); |
} |
} |
} |
Let us know if you have any questions.
Regards,
Peter
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center

Thank you for the reply.
When I insert radiobuttonlist or text box in AdvancedEditTemplate or AdvancedInsertTemplate, and when I want to insert a appointment, its displaying only the radiobuttonlist or textbox, its not displaying all the fields like description field, start time, end time, resource types.....
I want every thing on the appointment insert form(including radiobutton in the templates), please let me know the procedure.
Also one more question in that appointment insert form, is it possible that if I select one list item in the radiobutton list, then based on that event a new dropdownlist(may be resource type) should be dispalyed?
Regards
That's understandable. Sorry for not providing you with a more complete solution. You need to create the other controls using Templates. Please, follow the online example and let us know if you have questions.
All the best,
Peter
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center

Here I have another question, in the normal scheduler, while inserting appointment in the appointment form, if we select recurring appointment check box then other fields like recurrence and range of recurrence gets displayed. Then how this can be achieved using the templates???
My requirement is if given a field with options(radio button list) yes/no....a drop down should be dispalyed when the user selects 'yes'.

Thanks.

It has been 2 working days already but no answer.
We understand what you want to achieve and it makes perfect sense. Unfortunately, RadScheduler doesn't support this functionality yet. However, I have discussed your inquiry with our development team and we will consider exposing a template which will allow partial customization of the advanced form, while preserving the functionality related to recurrence and resources.
Kind regards,
Peter
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center

Thanks for your involvment. We will try to implement this feature as soon as possible.
Regards,
Peter
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center

have you allready scheduled this to implementation? We are really waiting for this feature.
Br,
Sami
I am glad to inform you that the Customizing the Advanced Template example is already finalized. The accompanying help article is not live yet, so I am sending it to you as a word document.
The user controls can be found in your local installation of of the latest Telerik.Web.UI Futures (attached is a screenshot of which file you need to download) at this location:
Live Demos\Scheduler\Examples\AdvancedFormTemplate\DefaultTemplates
Should you have any questions, please feel free to contact us.
All the best,
Peter
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center

We'll try implementin it to our software right away.
Br,
Sami

In both advanced and regular insert/edit modes?
Without using Templates?
Yes, you can handle AppointmentInsert and AppointmentUpdate(e.ModifiedAppointment) to achieve this. For example:
protected
void
RadScheduler1_AppointmentInsert(
object
sender, AppointmentInsertEventArgs e)
{
if
(e.Appointment.Resources.GetResourceByType(
"User"
) ==
null
)
e.Appointment.Resources.Add(
new
Resource(
"User"
, 1,
"Alex"
));
}
Regards,
Peter
the Telerik team

I would like to have a second resource, but not let the end user choose the value of that resource. So I would need the combo box hidden so they don't see an empty combo box on the advancedinsert form. Is that possible?
Yes, you can access the resource RadComboBox in FormCreated and set its Visible property to false. Here is a kb article for reference -
http://www.telerik.com/support/kb/aspnet-ajax/scheduler/how-to-access-controls-in-the-advanced-form.aspx
Kind regards,
Peter
the Telerik team


Going back to the first question: "How to display a message if no resource value is selected"
I want to achieve it with something similar as the SubjectValidator in the AdvancedForm (see attached image).
How can I do that?

Anybody outhere?
I need help!
You can download a sample from the code library that shows amongst many other scenarios how to add a new custom validator for the description field. You can follow the approach and adapt it for a resource validation as well.
Greetings,
Peter
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.

I am trying modify the default edit appointment form using <AdvanceEditTemplate>. After adding controls to this template, when i click any appointment .. Edit form is not opening...simply page is getting refreshed.
code is like this in my .aspx page,
<
telerik:radscheduler
ID
=
"RadScheduler1"
runat
=
"server"
SelectedView
=
"MonthView"
Font-Bold
=
"False"
Height
=
"485px"
Width
=
"824px"
EnableEmbeddedBaseStylesheet
=
"true"
EnableEmbeddedSkins
=
"true"
style
=
"margin-right: 16px"
Skin
=
"Vista"
onformcreated
=
"RadScheduler1_FormCreated"
onprerender
=
"RadScheduler1_PreRender"
OnAppointmentCommand
=
"RadScheduler1_AppointmentCommand"
>
<
MonthView
HeaderDateFormat
=
"MMMMMMMM, yyyy"
/>
<
Localization
HeaderTimeline
=
"Agenda"
/>
<
AdvancedEditTemplate
>
<
asp:TextBox
ID
=
"TitleTextBox"
Rows
=
"5"
Columns
=
"20"
runat
=
"server"
Width
=
"95%"
TextMode
=
"MultiLine"
></
asp:TextBox
>
<
div
style
=
"position: relative"
>
<
span
>Teachers:</
span
><
br
/>
<
asp:CheckBoxList
ID
=
"TeachersCheckBoxList"
runat
=
"server"
>
</
asp:CheckBoxList
>
</
div
>
<
br
/>
<
br
/>
<
div
>
<
span
>Students:</
span
><
br
/>
<
asp:CheckBoxList
ID
=
"StudentsCheckBoxList"
runat
=
"server"
>
</
asp:CheckBoxList
>
</
div
>
<
asp:LinkButton
ID
=
"UpdateButton"
runat
=
"server"
Text
=
"Update"
CommandName
=
"Update"
/>
</
AdvancedEditTemplate
>
</
telerik:radscheduler
>
Please help me..
How do you handle FormCreated?
If the advanced form is modal, please use this topic - http://www.telerik.com/help/aspnet-ajax/scheduler-custom-modal-advanced-template.html.
All the best,
Peter
the Telerik team

In the Form created event , I am just binding the data to the controls which are inside Advanced template.
But ,i hope there is no difference between Advanced template which i have designed and posted in this thread and the example you provided..
Can you please provide a sample application .. so that it will give better clarity on this.
Thanks ,
Govind.
If you use the Advanced Templates, there is no need to handle FormCreated. You can download a sample from here.
Best wishes, Peter
the Telerik team

Hello
I have a Resource that I'm loading from code. This resource renders as a drop down. (See attached) I want to know if there is a way to access the drop down in the code behind or client side so I can hide or disable the drop down.
Your help will be truly appreciated.
Also you might notice that time and date show is 2 different lines. I'm not Shure why. If you can shed some light on this I’ll appreciate it also
Thank you!
You can access controls of the advanced form from code behind in the FormCreated event of RadScheduler. Here is a help topic for more details.
For a client side approach, please see this topic.
Regards,
Peter
the Telerik team

I've used the examples given here and it has almost solved all the issues I was facing, except a small bit. I am able to insert a custom resource type by selecting from the drop down into the database, but when I am editing the same appointment, how do I display the resources that I selected while inserting the appointment. for example, the appointment data types like description, location are all displayed automatically, but in regards to the custom resources I am not sure how to display. The drop down displays all the values, but I want to select one that I have preselected and pass it from the database .
In other words..as in the Example below is how I get the values for the dropdown and in my database (through another query) I get the purposeid. I want this purposeid to be selected when I display the edit appointment. Can you please help?
ResourceType resMeetingRoomPurpose = new ResourceType
{
DataSource = DBHelper.GetMeetingRoomPurposes(),
KeyField = "purposeid",
ForeignKeyField = "purposeid",
TextField = "Purpose",
AllowMultipleValues = false,
Name = "Purpose"
};

Any help will be much appreciated. I have used this without templates and I need to preselect only one resource. Please help
Since this thread is quite long it is not quite clear which exactly scenario are you implementing. Generally preselecting of the appropriate resource is a functionality that is usually inbuilt in RadScheduler. If you are using Custom Advanced form you will have to implement it as in this on-line demo. You can get the isolated code from this Code Library.
Hope this will be helpful.
Plamen
the Telerik team


You can use onFormCreated event as it is described in Change the selected index of a resource combobox so always one option is preselected section of this help topic.
Hope this will be helpful.
Plamen
Telerik

I use RadScheduler in my application...created resource collection and populated with some data.....but in the drop down by default the first list item is dispalyed as '-' which I dont want.I want default value irrespective of "-".
just few mins back seen ur reply to this kind of issue
This behavior is by design. If no resource of a specific type is associated with the appointment, the "-" option is selected for the dropdown list. (posted on dec 27 2007) ...... got any solution to this issue .

I am attaching a sample web page where similar behavior is implemented. Hope this will be helpful.
I would also like to recommend you if you are having a urgent issue connected with RadControls to use your support tickets system.
Plamen
Telerik

It is not clear what do you mean by "using radresource". Would you please share which exactly scenario and binding from our on-line demos are you using so we could provide solution?
Plamen
Telerik

Thanks For the Reply my issue is u had attached sample file on 5th of this month which consists of radcombobox in radschedualr but we are using "ResourceType" in Radschedular by this we are getting "-" value default in "ResourceType" we don't want such "-" value default.Instead of "-" value we want "ACTIVE" value to be placed default in radschedular using radresouce type but not with radcombobox.
Unfortunately I could not find any attached file and it is still not clear what is the difference of the scenario that you are implementing. Would you please elaborate is you using AdvancedTemplate scenario or the default insert/update form?
Plamen
Telerik

Attached File Named as :changeResourceDefaultValue.Zip dated on 5th of this month(In This Page only). AttachedFile consists of radcombobox in radschedualr but we are using "ResourceType" in Radschedular by this we are getting "-" value default in "ResourceType" we don't want such "-" value default.Instead of "-" value we want "ACTIVE" value to be placed default in radschedular using radresouce type but not with radcombobox.
Now I think the scenario a bit more clear.
In your case you are defining the resources from the mark up as in this on-line demo while in the project I attached it was done from a custom provider. The only difference that have to be done in the code is that instead of "ResRoom" you should find the control in the code behind by using "Res"+ Yuur ResourceType Name. This should let you find the correct RadComboBox in the advanced form and change the text of the selected item according to your scenario.
Plamen
Telerik

hi i am using radscheduler, while i am created new appointment template, The template inside subject and Start Date End Date, CheckboxList radcombobox isthere, tow type of checked option if i clicked checkbox1 i want load radcombobox in checkbox1 related data at same time i clicked checkbox2 i want load radcombobox in checkbox2 related data
Please help me