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

Add Numbe of appoinments to Cell

5 Answers 88 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
David Lopez
Top achievements
Rank 1
David Lopez asked on 26 Jul 2010, 05:53 PM
Hello everyone,

I need to organize a big amount of appoinments in my scheduler, and I want to know in a quick view to the scheduler which days has more appoinments. Is there someway which I can show (next to the day number e.g.) the number of appoinments for each day?

Thanks a lot.

5 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 29 Jul 2010, 01:27 PM
Hi David,

Please, try the following code and let me know if you have further questions:
protected void RadScheduler1_TimeSlotCreated(object sender, TimeSlotCreatedEventArgs e)
   {
       if (RadScheduler1.SelectedView == SchedulerViewType.MonthView)
       {
           Literal numberOfAppointments = new Literal();
           numberOfAppointments.Text = "number of appointments: " + e.TimeSlot.Appointments.Count.ToString();
           e.TimeSlot.Control.Controls.Add(numberOfAppointments);
       }      
   }


Greetings,
Peter
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
david lopez
Top achievements
Rank 1
answered on 29 Jul 2010, 09:42 PM
Hi Peter, that was exactly what i needed it!

Thanks a lot man,

Cheers.
0
David Lopez
Top achievements
Rank 1
answered on 30 Jul 2010, 08:00 AM
Hi Peter,

That function returns the number of appoinments visible in each slot, but I want to get the total number of appoinments inside each cell.
As I have by defualt in the month view 4 appoinments max. per cell, but in the week mode, I have more than 4 appoinments.

I think that if I use the day view, I can get the number, bu I would like to see in the month view.

Thanks for your help.

0
Accepted
Peter
Telerik team
answered on 30 Jul 2010, 05:09 PM

Good point, David. Please, try the following modification to the code:
protected void RadScheduler1_TimeSlotCreated(object sender, TimeSlotCreatedEventArgs e)
   {
       if (RadScheduler1.SelectedView == SchedulerViewType.MonthView)
       {
           Literal numberOfAppointmentsLiteral = new Literal();
           int numberOfappointments = RadScheduler1.Appointments.GetAppointmentsInRange(e.TimeSlot.Start, e.TimeSlot.End).Count;
           numberOfAppointmentsLiteral.Text = "number of appointments: " + numberOfappointments.ToString();
           e.TimeSlot.Control.Controls.Add(numberOfAppointmentsLiteral);
       }       
   }



Greetings,
Peter
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
David Lopez
Top achievements
Rank 1
answered on 02 Aug 2010, 08:24 AM
Cool Peter, that solved my problem.

Thanks a lot for your help.

BR,

David.
Tags
Scheduler
Asked by
David Lopez
Top achievements
Rank 1
Answers by
Peter
Telerik team
david lopez
Top achievements
Rank 1
David Lopez
Top achievements
Rank 1
Share this question
or