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

show extra number of appointments on day

7 Answers 82 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Raju
Top achievements
Rank 1
Raju asked on 31 Jan 2013, 07:31 AM
Hi,

I have schedular on my page. i set MonthView-VisibleAppointmentsPerDay=4 for my schedular.
i want to display the showmore message as the count of extra appointments on that day.


Please help...


Thanks 
Raju

7 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 31 Jan 2013, 09:36 AM
Hi Raju

The MonthView-VisibleAppointmentsPerDay property itself determines the number of appointments a cell in Month view can display and then if the number of appointments for a day exceeds this limit, the cell displays a link labeled "more..."
Then set MonthView-AdaptiveRowHeight to "true" to allow independent row height.

Thanks
Princy
0
Raju
Top achievements
Rank 1
answered on 31 Jan 2013, 09:53 AM
Hi Princy,

I want to show the custom message like

if there are 7 appointments in a cell. And i set MonthView-VisibleAppointmentsPerDay=4. Then the message should be "3 more". 

For this i used the below code.

protected void radSchedulerAssignments_TimeSlotCreated(object sender, TimeSlotCreatedEventArgs e)
        {
             
                if (e.TimeSlot.Appointments.Count > 4)
                {
                    int temp = e.TimeSlot.Appointments.Count - 4;
  
                    //radTeacherSchedulerAssignments.Localization.ShowMore = "+ " + temp + " more ...";
                      
                    radTeacherSchedulerAssignments.Appointments[Convert.ToInt32(e.TimeSlot.Index)].Owner.Localization.ShowMore = "+ " + temp + " more ...";
                    radTeacherSchedulerAssignments.Appointments[Convert.ToInt32(e.TimeSlot.Index)].Owner.MonthView.VisibleAppointmentsPerDay = 4;
                    UPSchedulerAssigns.Update();
  
                }
             
        }


it is showing as per my requirement. But the problem is same message for all cells which have extra appointments more than 4. It is taking last cell count which is having extra appointments more than 4.


Example:

cell 1 having 7 appointments
cell 3 having 6 appointments
then it is showing "2 more" message for both cells.


Thanks 
Raju
0
Raju
Top achievements
Rank 1
answered on 01 Feb 2013, 05:11 AM
Hi Princy, Please address my issue....
0
Raju
Top achievements
Rank 1
answered on 04 Feb 2013, 09:40 AM
Hello telerik team...

Can you please resolve my issue. 

regards
Raju
0
Plamen
Telerik team
answered on 04 Feb 2013, 11:23 AM
Hi Raju,

 
Here is one way to achieve such functionality:

protected void RadScheduler1_TimeSlotCreated(object sender, TimeSlotCreatedEventArgs e)
    {
         
        RadScheduler scheduler = (RadScheduler)sender;
        if (scheduler.SelectedView==SchedulerViewType.MonthView)
        {
            if (e.TimeSlot.Appointments.Count>0)//count of visible appointments
            {
                int visibleAppointments = RadScheduler1.MonthView.VisibleAppointmentsPerDay;
                int realCountOfAppointments= scheduler.Appointments.GetAppointmentsInRange(e.TimeSlot.Start, e.TimeSlot.End).Count;//count of all appointments in the timespan
 
                if (realCountOfAppointments - visibleAppointments>0)
                {
                    e.TimeSlot.CssClass = (realCountOfAppointments - visibleAppointments) + "moreAppointments";
                }
               
            }
        }
<script type="text/javascript">
 
           function pageLoad() {
               var $ = $telerik.$;
               $("[class$='moreAppointments']").each(function(index,elem){
                   $(this).find(".rsShowMore").text($(this).attr("class").substring(0, $(this).attr("class").indexOf("moreAppointments")) + " more");
                  
               });
 
           }

Hope this will be helpful.

All the best,
Plamen
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
Raju
Top achievements
Rank 1
answered on 04 Feb 2013, 12:41 PM
Hi Plamen,

I have tried the code given, but not able to achieve the desired functionality.

Thanks
Raju K
0
Plamen
Telerik team
answered on 04 Feb 2013, 01:20 PM
Hi Raju,

 
I am attaching my test Web Page where the test of the more button was changed accordingly.

Hope this will be more helpful.

Greetings,
Plamen
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
Raju
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Raju
Top achievements
Rank 1
Plamen
Telerik team
Share this question
or