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

How to disable certain days on scheduler?

3 Answers 206 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Ming Yang
Top achievements
Rank 1
Ming Yang asked on 08 May 2008, 02:47 AM
Hi, I have some questions on how to use the scheduler:
1. How to block some days on the scheduler so that the users cannot schedule any appointments on that day? Is there any way to show those days with a different Css style so that users know it is not meant to be clicked?
2. Is there a way to disable the Navigation icon on certain months so that users know it cannot be clicked?
3. Is there a way to setup Apponitment CssClass in DESIGN time? I know how to set it up in running time at code and feel that it would be nice if I can do it in design time. Yet I cannot figure it out.

Thanks

3 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 12 May 2008, 02:29 PM
Hi Ming,

1. You can check for the Start time of the TimeSlot object and set your custom css class accordingly:
protected void RadScheduler1_TimeSlotCreated(object sender, TimeSlotCreatedEventArgs e)  
{  
    //The code bellow will apply a Custom CssClass to all timeslots which   
    //are before the today's day including today:  
    if (e.TimeSlot.Start.CompareTo(DateTime.Now) == -1)  
        e.TimeSlot.CssClass = "Custom";  

We will also expose a TimeSlot.Enabled property which if set to false will prevent inserting appointments for this timeslot. Meanwhile you can workaround this limitation cancelling the OnClientAppointmentInserting event based on your custom condition: 

function OnClientAppointmentInsertingHandler(sender, eventArgs)  
        {  
            if(MyCondition)             
            eventArgs.set_cancel(true);  
        } 

2. Which navigation icon do you mean? You can open a support ticket and send us a screenshot to help us better understand what you would like to achieve.

3. Currently, RadScheduler does not support setting CssClass property for appointments in design time, but we will consider this suggestion.

If you have any other questions, please feel free to contact us.



Peter
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Zoinky
Top achievements
Rank 1
answered on 22 Dec 2008, 04:58 PM
was TimeSlot.Enabled  ever implemented? if not when can we expect this?
0
Peter
Telerik team
answered on 23 Dec 2008, 09:13 AM
Hello Zoinky,

There will be TimeSlot.ReadOnly property which we will implement in the near future. For now you will have to use the workaround from the kb article.

Thanks for your inquiry.


Peter
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Scheduler
Asked by
Ming Yang
Top achievements
Rank 1
Answers by
Peter
Telerik team
Zoinky
Top achievements
Rank 1
Share this question
or