Scheduler in Sharepoint

3 posts, 0 answers
  1. Dasha
    Dasha avatar
    80 posts
    Member since:
    Aug 2010

    Posted 18 Aug 2011 Link to this post

    Dear Support,

    I'm trying to follow your example here and set up a web part that utilizes all the features.  My problem is getting the ajax scripts running.  I followed the instructions from this thread, and also I tried registering the scripts from this article.  So far I'm registering the following:

    string telerikAssembly = typeof(RadScheduler).Assembly.FullName;
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Splitter.RadSplitterScripts.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Common.TouchScrollExtender.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Splitter.RadSlidingZoneScripts.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Ajax.Ajax.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Common.Core.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Common.jQuery.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Common.jQueryPlugins.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Common.Popup.PopupScripts.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Common.Navigation.NavigationScripts.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Menu.RadMenuScripts.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Menu.ContextMenu.RadContextMenuScripts.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Input.TextBox.RadInputScript.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Input.DateInput.RadDateInputScript.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Input.NumericTextBox.RadNumericInputScript.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Calendar.RadTimeViewScripts.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Calendar.RadCalendarCommonScript.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Calendar.RadCalendarScript.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Calendar.RadDatePicker.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Calendar.RadDateTimePickerScript.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.ComboBox.RadComboBoxScripts.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Scheduler.RadSchedulerScripts.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Scheduler.ContextMenu.Plugin.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Scheduler.Views.Week.Model.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Scheduler.Views.Week.GroupedByResource.Model.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Scheduler.Views.Week.GroupedByDate.Model.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Scheduler.Views.MultiDay.Model.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Scheduler.Views.MultiDay.GroupedByResource.Model.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Scheduler.Views.MultiDay.GroupedByResource.Model.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Scheduler.Views.Day.Model.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Scheduler.Views.Day.GroupedByResource.Model.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Scheduler.Views.Month.Model.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Scheduler.Views.Month.GroupedByResource.Model.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Scheduler.Views.Month.GroupedByDate.Model.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Scheduler.Views.Timeline.Model.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Scheduler.Views.Timeline.GroupedByResource.Model.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Scheduler.Views.Timeline.GroupedByDate.Model.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Scheduler.Scheduling.AdvancedTemplate.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Scheduler.Helpers.DateTime.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Scheduler.RecurrenceEditor.RecurrenceEditor.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.PanelBar.RadPanelBarScripts.js", telerikAssembly));


    The callbacks only work if I put the RadScheduler control on the page and nothing else.  Once I start adding the other elements from the example, I can't use any of the built-in functionality, like collapse/expand the left pane, scroll through dates, switch scheduler views, etc.  Please help!

    I'm using the build version=2011.2.712.35.

    Thank you,

    Dasha.
  2. Cat Cheshire
    Cat Cheshire avatar
    128 posts
    Member since:
    Jun 2010

    Posted 24 Aug 2011 Link to this post

    There are RadCalendar, RadPanelBar and many other controls at the demo - have you registered the scripts of these controls manually as you have made for the RadScheduler?

    It is known that SharePoint has issues when the RadAjaxManager is declared at markup in a user control.
    You can overcome this by adding the RadAjaxManager at OnInit event of the web part.
    Then add the relevant AjaxSettings programmatically - for example like this:
    private const string_ascxPath = @"~/_CONTROLTEMPLATES/SchedulerWebPartProject/SchedulerWebPart/VisualWebPart1UserControl.ascx";
      
    protected override void CreateChildControls()
    {
    }
      
    RadAjaxManager ajaxmgr;
    protected override void OnInit(EventArgs e)
    {
      
        base.OnInit(e);
      
        ajaxmgr = new RadAjaxManager();
        Page.Items.Add(typeof(RadAjaxManager), ajaxmgr);
        Page.Form.Controls.AddAt(0, ajaxmgr);
      
    }
      
    protected override void OnLoad(EventArgs e)
    {
        base.OnLoad(e);
      
        Control control = Page.LoadControl(_ascxPath);
        Controls.Add(control);
      
        RadCalendar calendar = control.FindControl("RadCalendar1") as RadCalendar;
        RadScheduler scheduler = control.FindControl("RadScheduler1") as RadScheduler;
        // the calendar updates the scheduler:
        ajaxmgr.AjaxSettings.AddAjaxSetting(calendar, scheduler);
    }
  3. Dasha
    Dasha avatar
    80 posts
    Member since:
    Aug 2010

    Posted 24 Aug 2011 Link to this post

    Cat,

    I after my debugging, it turned out that my mistake was in the order of the scripts.  Even though I was registering them all, I was not observing the correct order.  This was the correct solution:

    string telerikAssembly = typeof(RadScheduler).Assembly.FullName;
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Common.Core.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Common.jQuery.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Common.jQueryPlugins.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Common.TouchScrollExtender.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Common.Navigation.NavigationScripts.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.ComboBox.RadComboBoxScripts.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Common.Scrolling.ScrollingScripts.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Menu.RadMenuScripts.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Rating.RadRating.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Ajax.Ajax.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Splitter.RadSplitterScripts.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Splitter.RadSlidingZoneScripts.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Calendar.RadCalendarCommonScript.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Calendar.RadCalendarScript.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.PanelBar.RadPanelBarScripts.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Common.Popup.PopupScripts.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Input.TextBox.RadInputScript.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Input.DateInput.RadDateInputScript.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Input.NumericTextBox.RadNumericInputScript.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Calendar.RadTimeViewScripts.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Calendar.RadDatePicker.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Calendar.RadDateTimePickerScript.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Scheduler.RadSchedulerScripts.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Scheduler.ContextMenu.Plugin.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Scheduler.Views.Week.Model.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Scheduler.Views.Week.GroupedByResource.Model.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Scheduler.Views.Week.GroupedByDate.Model.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Scheduler.Views.MultiDay.Model.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Scheduler.Views.MultiDay.GroupedByResource.Model.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Scheduler.Views.MultiDay.GroupedByResource.Model.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Scheduler.Views.Day.Model.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Scheduler.Views.Day.GroupedByResource.Model.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Scheduler.Views.Month.Model.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Scheduler.Views.Month.GroupedByResource.Model.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Scheduler.Views.Month.GroupedByDate.Model.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Scheduler.Views.Timeline.Model.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Scheduler.Views.Timeline.GroupedByResource.Model.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Scheduler.Views.Timeline.GroupedByDate.Model.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Scheduler.Scheduling.AdvancedTemplate.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Scheduler.Helpers.DateTime.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Scheduler.RecurrenceEditor.RecurrenceEditor.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Menu.ContextMenu.RadContextMenuScripts.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Slider.RadSliderScripts.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.ToolBar.RadToolBarScripts.js", telerikAssembly));
    scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.ListBox.RadListBoxScripts.js", telerikAssembly));

    Now my calendar works beautifully like in the demo.

    I guess I should point out that I got it working wothout the AjaxManager, but rather by putting everything in a RadAjaxPanel.  I've had much better experiences with the panel in SP that with the ajax manager.

    Dasha
Back to Top