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

Only create timeslot where Appointment is given

7 Answers 86 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Prashant
Top achievements
Rank 1
Prashant asked on 27 Feb 2012, 08:51 AM
Hi,

I am using Rad Scheduler to show the appointment on daily basis. What i want is, that if there is no appointment for a particular slot then that slot should not be created.
for example i have this on datatable  
9:00 Am to 10:00 Am | Do something
10:00 Am to 11:00 Am | Do nothing
and then
1:00 Pm to 2:00 Pm | Do something Again

so what i did, i have set 9:00 Am as start time and 2:00 Pm as end time
it had also created time slot for 11:00 to 12:00 and 12:00 to 1:00 which are not in Datatable.

i did tried 
 if (e.TimeSlot.Appointments.Count < 1)
        {
            e.TimeSlot.Control.Visible = false;
          }
but still i can see hours on Hours Column and blank space in between the time slot.
is there any way i can stop the time slot from creating or create timeslot according to slot's in Datatable.
Please help.
Thanks 
Prashant Rawat
 

7 Answers, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 28 Feb 2012, 03:51 PM
Hello,

 
This scenario is not supported by RadScheduler. One way to achieve similar scenario is to disable the time slots that you do not need as shown in this KB article.

Hope this information is helpful. 

Kind regards,
Plamen Zdravkov
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
Prashant
Top achievements
Rank 1
answered on 01 Mar 2012, 05:37 AM
Hi Plamen, 

Thanks for your reply.
So instead of hiding them i can only disable them.

Regards
Prashant
0
Plamen
Telerik team
answered on 01 Mar 2012, 01:11 PM
Hello Prashant,

 
You can also hide the Time Slots but this can affect some other functionality of RadScheduler and cause it to not work as expected. That is why we do not recommend and support such custom implementation.

Greetings,

Plamen Zdravkov
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
Prashant
Top achievements
Rank 1
answered on 01 Mar 2012, 01:24 PM
Hi Plamen,  

Can you please tell me the way to hide slots, I know it is not recommended(as you said in previous post) but i would like to give it a try.

Thanks
Prashant  
0
Plamen
Telerik team
answered on 05 Mar 2012, 01:31 PM
Hi Prashant,

You  can make a slot visible false as in the code bellow:

protected void RadScheduler1_TimeSlotCreated(object sender, TimeSlotCreatedEventArgs e)
   {
       if (e.TimeSlot.Start.Date<DateTime.Now.Date)
       {
           e.TimeSlot.Control.Visible = false;
       }
   }

Hope this will help you.

Greetings,
Plamen Zdravkov
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
Prashant
Top achievements
Rank 1
answered on 06 Mar 2012, 11:34 AM
Hi Plamen,

As you can see on my first post i did tried the 
 
        e.TimeSlot.Control.Visible = false; 

but it results in blank space in between the time slots and i can see the time in hours panel.

Thanks for your reply.

Regards 
Prashant

0
Plamen
Telerik team
answered on 09 Mar 2012, 11:00 AM
Hi Prashant,

 
You can also hide them by changing their css dynamically in the pageLoad as it is shown in this forum post.

Hope this will help you.

Regards,
Plamen Zdravkov
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
Scheduler
Asked by
Prashant
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Prashant
Top achievements
Rank 1
Share this question
or