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

Change Timeslot Background color

7 Answers 174 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
xtreme
Top achievements
Rank 1
xtreme asked on 23 Sep 2011, 08:16 PM
Hello! How do you change the timeslot background color on Client side? I found some sample using server side but none with client side. I'm using Radschduler .net ajax Q3 2010 and the data is fed using Web Services. Also, when using Web services for RadScheduler, some server side event as TimeSlotContextMenuItemClicking, AppointmentDataBound ... stop working. Is this a bug? Thank you.

7 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 26 Sep 2011, 02:23 PM
Hello,

Try the following client side code to change the Timeslot background color
Javascript:
<script type="text/javascript">
function OnClientTimeSlotClick(sender, args)
{
 args.get_targetSlot().get_domElement().style.backgroundColor = "red";
}
</script>

Thanks,
Princy.
0
xtreme
Top achievements
Rank 1
answered on 28 Sep 2011, 03:06 PM
Thank you. It works. Also, do you know how can I display or hide appointments on client side? I'm using WebService for RadScheduler and trying to filter appointments based on Resources. Thanks in advance.
0
Princy
Top achievements
Rank 2
answered on 29 Sep 2011, 06:24 AM
Hello,

Try the following Javascript to hide/show appointments.
<script type="text/javascript">
function HideAppointment()
{
 var Scheduler = $find('<%= RadScheduler1.ClientID %>');
 var app1 = Scheduler.get_appointments();
 alert("Hiding the appointment : " + app1.getAppointment(1).get_subject());
 app1.getAppointment(1)._domElements[0].style.display = "none";   
}
function ShowAppointment()
{
 var Scheduler = $find('<%= RadScheduler1.ClientID %>');
 var app1 = Scheduler.get_appointments();
 alert("Showing the appointment : " + app1.getAppointment(1).get_subject());
 app1.getAppointment(1)._domElements[0].style.display = "block"
</script>

Thanks,
Princy.
0
xtreme
Top achievements
Rank 1
answered on 30 Sep 2011, 06:01 PM
Princy,
Thank you for your reply. In the same case, using WebService for RadScheduler, I just notice that the server side OnNavigationComplete does not fire when you switch between Views. If I have another control that cause a postback on the page, the scheduler will loose the current view. What should I do to handle this case? Thanks.
0
Ivana
Telerik team
answered on 03 Oct 2011, 10:20 AM
Hello Xtreme,

You could set the time view in pageLoad() client-side event.
Also you could use a hidden field to store the current state of the time view and then get its value when pageLoad() is called on client-side.

For more information about the client-side programming of the RadScheduler you could refer the following help article at our web-site: RadScheduler: Client-Side Programming.

Best wishes,
Ivana
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
xtreme
Top achievements
Rank 1
answered on 18 Oct 2011, 05:43 PM
How do use AppointmentTemplate  when you using WebService for data? I use this piece of code but it does not work

<

 

 

AppointmentTemplate>

 

 

 

<div class="rsAptSubject">

 

<%

 

# Eval("Subject") %>

 

 

 

</div>

 

<%

 

# Eval("Description") %>

 

 

 

</AppointmentTemplate>

 


Do I need to set somewhere else? Remember I am using WebService. Thanks.
0
Ivana
Telerik team
answered on 21 Oct 2011, 04:21 PM
Hi Xtreme,

Take a look at the following demo: RadScheduler: Web Service Binding. If you go trough the demo description you will see that the demo is using a templates for the appointments.

To create your own template for the appointments you need to download the jQuery Template plugin, which could be downloaded from the official jQuery website. 
You could refer to the code of the demo linked above, to see how the implementation of a custom appointment template is done.

Hope this helps.

All the best,
Ivana
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
General Discussions
Asked by
xtreme
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
xtreme
Top achievements
Rank 1
Ivana
Telerik team
Share this question
or