none
why the SPCalendarView cannot be use RRS feed

  • Question

  • I create a SPCalendarView in my webpart and put a SPCalendarItemCollection to that. However, it is just showing a SP calendar view which the event does not show. Also, all button of the calendar is not clickable.

    Could anyone tell me what step is missed in the code below?

    https://i.imgsafe.org/5df008abc2.png

    ^all button is not clickable. next/prev, day/week/month, expand and Collapse button

    aspx: 

    <SharePoint:SPCalendarView ID="spCalendarViews" runat="server">
    </SharePoint:SPCalendarView>

    C#:

    protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                // Current web
                SPWeb web = SPContext.Current.Web;
                // List data
                DataTable results = GetQueryData(web);
    
                // Calendar Item Collection
                SPCalendarItemCollection items = GetCalendarItems(web, results);// items.count => 4 
    
                spCalendarViews.EnableViewState = true;
                spCalendarViews.EnableV4Rendering = true;
    
                // Calendar Type
                spCalendarViews.ViewType = GetCalendarType("month");
    
    
                // Bind the datasource to the SPCalendarView
               spCalendarViews.DataSource = items;
               spCalendarViews.DataBind();
    
            }
            catch (Exception ex)
            {
            }
        }

    Wednesday, January 11, 2017 7:31 AM

All replies