Number of appointments shown on calandar month view

11 posts, 0 answers
  1. Dave Miller
    Dave Miller avatar
    64 posts
    Member since:
    Oct 2004

    Posted 30 Oct 2008 Link to this post

    Is it possible to control the number of appointments shown on a day. If you have it set to show 2 appointments in month view there is actually room for 3 as the space is there for the "Show More" link if there are 3 or more.

    Is it possible to show 3 using the space the link would take and show the link with 4 or more?

    Thanks,
    Dave
  2. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 31 Oct 2008 Link to this post

    Hello Dave,

    Please, try setting MonthView-VisibleAppointmentsPerDay="3". Also, you may find useful the kb article on:
    How to show all appointments in Month View.



    Peter
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Dave Miller
    Dave Miller avatar
    64 posts
    Member since:
    Oct 2004

    Posted 31 Oct 2008 Link to this post

    Peter,

    What I was looking for was a way to check each day and if there were 3 or less show them and if there were more than three show to with the "Show  More" link so if there were more than 3 in one day it would just show 2 and the link and not create the extra space, for the link, below the ones with 3 or less.

    I guess what I am looking for is a way to control the VisibleAppointmentsPerDay on databound for a day by day basis depending on the number of appointments on that day.

    Thank,
    Dave

  5. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 03 Nov 2008 Link to this post

    Hi Dave,

    There should be always one extra space under the apponintments, no matter how many you set them to be visible in month view. This is by design and it is intended to allow users to insert additional appointments if needed by double-clicking on the extra space.

    If you want to control the number of visible appointments on a day by day basis, I think the kb article on How to show all appointments in Month View should help you achieve this. Have you had a chance to test the approach there? How is the functionality achieved via this kb article different from what you are need? Please, eleaborate and we will try to find a solution for you.


    Regards,
    Peter
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  6. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 03 Nov 2008 Link to this post

    Hi Dave,

    There should be always one extra space under the apponintments, no matter how many you set them to be visible in month view. This is by design and it is intended to allow users to insert additional appointments if needed by double-clicking on the extra space.

    If you want to control the number of visible appointments on a day by day basis, I think the kb article on How to show all appointments in Month View should help you achieve this. Have you had a chance to test the approach there? How is the functionality achieved via this kb article different from what you are need? Please, eleaborate and we will try to find a solution for you.


    Regards,
    Peter
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  7. Ted
    Ted avatar
    5 posts
    Member since:
    Oct 2008

    Posted 11 Nov 2008 Link to this post

    The link How to show all appointments in Month View appears to be broken.  Can you tell me where to find this knowledge base article?

    Thanks
  8. T. Tsonev
    Admin
    T. Tsonev avatar
    2770 posts

    Posted 12 Nov 2008 Link to this post

    Hi Ted,

    The KB is available again now. Sorry for the inconvenience.

    Kind regards,
    Tsvetomir Tsonev
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  9. Ted
    Ted avatar
    5 posts
    Member since:
    Oct 2008

    Posted 13 Nov 2008 Link to this post

    Tsvetomir,

    I downloaded the sample code for the Kb article How to show all appointments in Month View  and attempted to run iit using RadControls for ASP.Net AJAX Q3 2008.  I get the exception "HttpException was unhandled by user code": Data properties on data control 'RadScheduler1' such as DataSource, DataSourceID, and DataMember cannot be changed during the databinding phase of the control. This occurs in the method below for the statement "RadScheduler1.MonthView.VisibleAppointmentsPerDay = MaxCount[AppMonth - 1];"

    protected void RadScheduler1_DataBound(object sender, Eventers e)
    {

        //the MonthVisibleAppointmentsPerDay to MaxCount for each month. 
        int AppMonth = RadScheduler1.SelectedDate.Month; 
        RadScheduler1.MonthView.VisibleAppointmentsPerDay = MaxCount[AppMonth - 1];
    }


     

    Can you please advise on what I need to do in order to be able to display all the appointments on a given day without the Show More link and have the row sized by the maximum number of appointments for that week.

    Thanks,

    Ted

     

     

  10. T. Tsonev
    Admin
    T. Tsonev avatar
    2770 posts

    Posted 14 Nov 2008 Link to this post

    Hi Ted,

    This is strange. The code fragment is from the old version of the KB article. You might be looking at a cached version. This is the updated code:

    protected override void OnPreRender(EventArgs e)   
        {   
            if (RadScheduler1.SelectedView == SchedulerViewType.MonthView)   
            {   
                RadScheduler1.DataBind();   
      
                int maxAppointmentsPerDay = 2;   
                DateTime currentDay = RadScheduler1.VisibleRangeStart;   
                while (currentDay < RadScheduler1.VisibleRangeEnd)   
                {   
                    DateTime nextDay = currentDay.AddDays(1);   
                    IList<Appointment> visibleAppointments = RadScheduler1.Appointments.GetAppointmentsInRange(currentDay, nextDay);   
      
                    maxAppointmentsPerDay = Math.Max(maxAppointmentsPerDay, visibleAppointments.Count);   
                    currentDay = nextDay;   
                }   
      
                RadScheduler1.MonthView.VisibleAppointmentsPerDay = maxAppointmentsPerDay;   
            }   
      
            base.OnPreRender(e);   
        }  

    And the needed CSS selectors:

    <style type="text/css">   
        div.RadScheduler .rsMonthView .rsWrap          
        {          
            heightauto;          
            font-size: 0;        
            min-height10px/* * 4 = empty cell height */  
            line-height:10px;    
        }          
                
        div.RadScheduler .rsMonthView .rsDateWrap,        
        div.RadScheduler .rsWrap div.rsApt,        
        div.RadScheduler .rsRow div.rsShowMore        
        {          
            positionrelative;          
            font11px/16px verdana,sans-serif;        
        }    
        </style>  

    Let us know if you still have problems viewing the KB.

    Kind regards,
    Tsvetomir Tsonev
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  11. Ted
    Ted avatar
    5 posts
    Member since:
    Oct 2008

    Posted 14 Nov 2008 Link to this post

    Tsvetomir,

    The code fragment and css in your reply works great.  The project (zip) file with the KB article is where I got the code from my last post.  I think that project file needs to be updated.

    Thanks,

    Ted
  12. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 14 Nov 2008 Link to this post

    Hello Ted,

    Thanks for your observation. The sample project should be updated now.

    All the best,
    Peter
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017