locked
Help with disabling calendar view "more items" RRS feed

  • Question

  • Can anyone give me a quick pointer as to what I should be searching for in order to knock out the option to view "more items" within the calendar view and enable the row height to expand accordingly?

     

    Using WSSv3

     

    Thanks!

    Friday, April 11, 2008 3:52 PM

Answers

  • Thanks for that Andy, your suggestion almost gives me what I'm after.

     

    I stumbled across this post when looking up options to just default the calendar view/items to 'Expanded' is closer to the result that I'd like to achieve. Where the weekday height is determined by the 'Expand All' property being set, rather than displaying a fixed weekday height based on increasing the MaxVisibleEvents property, for all sites, when not required - http://forums.microsoft.com/TechNet/ShowPost.aspx?PostID=2144764&SiteID=17

     

    However, I tried to amend the ExpandedWeeks property to read as '1111111' and it didn't work for me? Even with having a MaxVisibleEvents property set/not set. I've been requesting resets following every change made/tested.

     

    Any help/pointers on getting this solution to work would be great!

     

    Thursday, April 17, 2008 8:22 AM

All replies

  • In WSS 3.0 or MOSS by default the calendar only shows 3 events per day before you have to click on the expand arrows, you can however change this number by modifying a section of the DefaultTemplates.ascx file located in

    C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\CONTROLTEMPLATES

     

    Before you make any changes to this file make sure you take a copy of it in case you make any mistakes

     

    Within this section you'll find a declaration
    for the MonthlyCalendarView which should look like this

    <Sharepoint:MonthlyCalendarView runat="server"
         SelectedDate='<%# DataBinder.Eval(Container,"SelectedDate","") %>'
         ExpandedWeeks='<%# SPHttpUtility.HtmlEncode(
    DataBinder.Eval(Container,"ExpandedWeeks","")) %>'
         ItemTemplateName="CalendarViewMonthItemTemplate"
         ItemAllDayTemplateName="CalendarViewMonthItemAllDayTemplate"
         ItemMultiDayTemplateName="CalendarViewMonthItemMultiDayTemplate"
         TabIndex=2
          >
          </Sharepoint:MonthlyCalendarView>

    All you need to do is add in the property MaxVisibleEvents & set it's value
    to what you want i.e. to get it to show 10 events before the expand arrow
    appears you'd use

    <Sharepoint:MonthlyCalendarView runat="server"
         SelectedDate='<%# DataBinder.Eval(Container,"SelectedDate","") %>'
         ExpandedWeeks='<%# SPHttpUtility.HtmlEncode(
    DataBinder.Eval(Container,"ExpandedWeeks","")) %>'
         ItemTemplateName="CalendarViewMonthItemTemplate"
         ItemAllDayTemplateName="CalendarViewMonthItemAllDayTemplate"
         ItemMultiDayTemplateName="CalendarViewMonthItemMultiDayTemplate"
         TabIndex=2
         MaxVisibleEvents=10
          >
          </Sharepoint:MonthlyCalendarView>

    Once you've made the change to the file & saved it you'll need to do an
    IISReset for it to take effect.

    From memory I think there is a maximum that MaxVisibleEvents can be set to which is 31


    Hope this helps
    Andy

    Wednesday, April 16, 2008 7:25 PM
  • Thanks for that Andy, your suggestion almost gives me what I'm after.

     

    I stumbled across this post when looking up options to just default the calendar view/items to 'Expanded' is closer to the result that I'd like to achieve. Where the weekday height is determined by the 'Expand All' property being set, rather than displaying a fixed weekday height based on increasing the MaxVisibleEvents property, for all sites, when not required - http://forums.microsoft.com/TechNet/ShowPost.aspx?PostID=2144764&SiteID=17

     

    However, I tried to amend the ExpandedWeeks property to read as '1111111' and it didn't work for me? Even with having a MaxVisibleEvents property set/not set. I've been requesting resets following every change made/tested.

     

    Any help/pointers on getting this solution to work would be great!

     

    Thursday, April 17, 2008 8:22 AM
  • I haven't played with the ExpandedWeeks property so can't give pointers on that.

     

    What I'd try next is to find out what javascript function the expand all button is doing by using the IE developers toolbar and then customize the Calendar page in SharePoint designer to call that function automatically on page load.  It's something I'll be looking at in the next couple of weeks as one of my clints want's SharePoint to remember that they've clicked the expand all when they change months as out of the box it defaults back to the collapsed view when you switch to a new month.  Unfortunately I'm at home without access to a SharePoint environment so can't try to find the info for you and with my current workload I don't know when I'll get chance to try it. 

     

    When I do get chance to look at this I'll put it on my blog and post back here if you haven't had any luck by then.

    Thursday, April 17, 2008 9:57 AM
  • All sorted, I can sleep easy tonight! ;-)

     

    The ExpandedWeeks property change mentioned about works for me on other servers where I haven't already had a play with the MaxVisibleEvents property.

     

    http://forums.microsoft.com/TechNet/ShowPost.aspx?PostID=3235571&SiteID=17&mode=1

     

    Thursday, May 15, 2008 1:16 PM
  • Hi Andy,
    I don't have the C:\Program Files\Common Files\Microsoft Shared\web server
    extensions\12\TEMPLATE\CONTROLTEMPLATES folder.  Is it possible for you to send me the DefaultTemplates.ascx file to me at michelp@microsoft.com?
    Wednesday, September 17, 2008 2:20 AM
  • Hi Andy,
    I don't have the C:\Program Files\Common Files\Microsoft Shared\web server
    extensions\12\TEMPLATE\CONTROLTEMPLATES folder.  Is it possible for you to send me the DefaultTemplates.ascx file to me at michelp@microsoft.com?
    Wednesday, September 17, 2008 2:20 AM
  • Setting of the MaxVisibleEvents value to a number greater than 3 is the perfect solution for me.  HOWEVER, my defaultTemplates.ascx changes simply have no effect.  Changing defaultTemplates.ascx itself causes my monthly calendar view to look terrible and the event links to not work.  And it does not actually have the desired effect of expanding the # of visible events.  I understand that changing this file is not supported.  So I created another ascx file in the CONTROLTEMPLATES directory and copied into it from the defaultTemplates file the Directives at the top along with the Templates that I want to override.  And yes, I did an IISRESET.  The result?  No visible changes whatsoever.  I even added some junk text "blah blah blah" within the html to be rendered out to the page.  Nothing shows up nor can it be found in the view source.

    Note that I checked to see if there was another custom template overriding the one I wanted to override.  There is not.

    Any idea why overriding templates seems to work for some people and not others?

    I will go the code route and extend the underlying classes if I have to.  It is just frustrating that some folks seem to be successful with simple template markup changes and I cannot get the changes to show up.  AAaaaaaaaahhhh!  Please help!

     

    Cheers.

    Monday, May 17, 2010 9:17 PM
  • I know, very frustrating. You might want to try the alternative option listed at the end of this post http://social.technet.microsoft.com/Forums/en-US/sharepointcustomization/thread/84824deb-e205-4052-a858-3febacd85e45

    Hope it helps

    Tuesday, July 20, 2010 4:43 PM