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

SharePoint 2010 and RadScheduler - weired behaviour

3 Answers 90 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Haider
Top achievements
Rank 1
Haider asked on 18 Dec 2012, 09:04 AM
Hi!

Is there anyone having experience with the integration of the Telerik AJAX controls and SharePoint 2010?   To make things certain, I've followed the instructions at http://www.telerik.com/help/aspnet-ajax/moss-create-ajax-enabled-sharepoint-webpart-radcontrols.html but I am encountering troubles:

First, i created the prototype in 100% pure ASP.NET 3.5 - no problems at all, behaving well.

Then I simply copy & pasted the source codes from the pure ASP.NET pages into SharePoint Application Pages.  My SharePoint development machine is a virtual image of a windows 2008 R2 server with SP2010, MS SQL 2008 R2 and MS VS2010.  Also in this environment everything is working as it should (see attached images "develop_srv_01" and "develop_srv_02").

But by deploying the *.WSP file to the production ("life") SharePoint server, all of a sudden bloody hell breaks out.

First of all - the Advanced Edit/Insert Form of the RadScheduler component does not open.  I would like to have it as a modal window but that does not work on the production server:  I double click in a TimeSlot of the RadScheduler.  The LoadingPanel indicates that "something happens" and, after a while, it goes back to normal (=no visual indication of business).  However, the AdvacedForm does not open (see attached image "prod_srv_01").

When I now click in the RadCalendar (which is located next to the Scheduler) then a PostBack is posted and - the AdvancedForm opens.  And that's where the fun begins!  In the Advanced Insert/Edit Form that opens this way, everything is going mad literally:

I have 2 resources in the Scheduler: Medics and Treatments.  "Medics" are defined as a single choise resource and "Treatments" are designed as a multiple choice resource.  Again, in the pure ASP.NET prototype and on the development server, everything is OK.  But on the production server (by "opening" the AdvancedForm in this buggy way) this becomes swapped:  Now all of a sudden "Medics" are a multiple choice resource and "Treatments" become a single choice resource (see attached image "prod_srv_02" and compare it against the 2 images from the development server).

In my code behind i instruct the RadScheduler:

 

protected void RadScheduler1_AppointmentDataBound(object sender, SchedulerEventArgs e)
{
    try
    {
        RadScheduler1.ResourceTypes.FindByName("Treatment").AllowMultipleValues = true;
        RadScheduler1.ResourceTypes.FindByName("Medic").AllowMultipleValues = false;
     }
     catch (System.Exception ex)
     {
         Logger.SharePointLog.LogEx(ex, "RadScheduler1_AppointmentDataBound");
     }
}

No exception is ever is thrown...

To make things even more complicated, I can easy tell the AdvancedForm not to open as a modal window but "inline" in the scheduler by setting

<AdvancedForm Modal="false"


and now the AdvancedForm does open when I double click a TimeSlot in the RadScheduler!   But again, even then I have the swapping of the single/multiple choice resources!

I've followed the instructions at http://www.telerik.com/help/aspnet-ajax/moss-create-ajax-enabled-sharepoint-webpart-radcontrols.html and modified the 2 web.config files on the production SharePoint server.  Guess those changes must be OK, otherwise I wouldn't see the Telerik AJAX controls on a SP page.  Session and View states are enabled.

My 1st guess was that "something" with the loading of the internal scripts of the Telerik Web UI DLL went wrong.  So i load them manually on every PostBack - without sucess.

Is there anyone out there who has a clue or can point me towards the right direction?  Or even has experienced this or a simmular situation and has sucessfully overcome it?

I don't want to post the whole Page here (there are quite some controls on it), but here is the RadScheduler in question:
<telerik:RadScheduler ID="RadScheduler1" runat="server" 
    SelectedView="MonthView" Culture="de-DE" FirstDayOfWeek="Monday" Height="800px" Width="100%" 
    HoursPanelTimeFormat="H:mm" MinutesPerRow="5" TimeLabelRowSpan="3"
    TimeZoneID="W. Europe Standard Time" TimeZoneOffset="01:00:00" OverflowBehavior="Expand" ColumnWidth="17%"
    WorkDayStartTime="09:00:00" WeekDayEndTime="18:00:00" DataEndField="DtmEnd" DataKeyField="ID" 
    DataStartField="DtmStart" DataSubjectField="Name" DataDescriptionField="Description"
    DataRecurrenceField="RecRule" DataRecurrenceParentKeyField="ID" OnClientAppointmentInserting="OnClientAppointmentInserting"
    Skin="Metro" AppointmentStyleMode="Default" OnAppointmentDataBound="RadScheduler1_AppointmentDataBound"
    OnAppointmentCreated="RadScheduler1_AppointmentCreated" EnableDescriptionField="True" OnFormCreated="RadScheduler1_FormCreated"
    EnableExactTimeRendering="True" DisplayRecurrenceActionDialogOnMove="True" WorkDayEndTime="18:00:00" ShowNavigationPane="false"
    OnTimeSlotCreated="RadScheduler1_TimeSlotCreated" 
    OnAppointmentCommand="RadScheduler1_AppointmentCommand"                          
    WeekView-UserSelectable="False" DayView-UserSelectable="False" MonthView-UserSelectable="False">
    <AdvancedForm Modal="true" Enabled="true" EnableResourceEditing="true" EnableCustomAttributeEditing="true" />
    <ResourceTypes>
        <telerik:ResourceType DataSourceID="SqlDataSourceMedics" ForeignKeyField="Medic" KeyField="ID" Name="Arzt" TextField="Name" />
        <telerik:ResourceType DataSourceID="SqlDataSourceTreatment" ForeignKeyField="Treatment" KeyField="ID" Name="Behandlung" TextField="Description" />
    </ResourceTypes>
    <Localization AdvancedNewAppointment="Neues Zeitfenster" AdvancedEditAppointment="Zeitfenster bearbeiten"
        AdvancedSubject="Betreff" AdvancedDescription="Beschreibung" AdvancedRecurrence="Serie" AdvancedRecurEvery="jeden"
        HeaderDay="Tag" HeaderMonth="Monat" HeaderTimeline="Zeitlinie"
        HeaderToday="Heute" HeaderWeek="Woche" Save="Speichern"
        Show24Hours="24 Stunden Ansicht" ShowBusinessHours="Arbeitszeit Ansicht" />
<AppointmentTemplate>
    <b><%# Eval("Subject") %></b>
    <br /><br />
    <asp:Label runat="server" ID="lblTreatments"></asp:Label>
    <br /><br />
    <asp:Label runat="server" ID="lblMedic"></asp:Label>
</AppointmentTemplate>
</telerik:RadScheduler>

and here is the code behind:

using System;
using System.Globalization;
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;
using System.Collections.Generic;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using Telerik.Web.UI;
 
namespace ShareVision.SharePoint2010.MedResWebParts.Layouts.MedResWebParts
{
 
    /// <summary>
    /// <para>
    /// MedRes Verwaltung durch Admin - TimeFrames.
    /// </para>
    /// <para>
    /// Ermöglicht das Erstellen von Einmal- und Serienterminen (=Behandlungen) durch den Arzt.
    /// </para>
    /// </summary>
    public partial class MgmtTimeFrame : LayoutsPageBase
    {
        /// <summary>
        /// Für 1:n Beziehungen kann der Telerik Scheduler keine automatische Datenbindung.
        /// Vielmehr muss man hierzu einen eigenen FactoryProvider erstellen welcher diese 1:n Zuordnung pflegt (insert/delete).
        /// </summary>
        private MedResSchedulerProvider provider;
 
        protected void Page_Init(object sender, EventArgs e)
        {
            //EnsureChildControls();
            provider = new MedResSchedulerProvider();
            provider.ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["MedResConnectionString"].ConnectionString;
 
            this.RadScheduler1.Provider = provider;
 
            System.Threading.Thread.CurrentThread.CurrentCulture = new CultureInfo("de-DE");
        }
 
 
        private ScriptManager CheckScriptManager()    
        {
            Page.ClientScript.RegisterStartupScript(typeof(MgmtTimeFrame), this.ID, "_spOriginalFormAction = document.forms[0].action;_spSuppressFormOnSubmitWrapper=true;", true);
            if (this.Page.Form != null)
            {
                string formOnSubmitAtt = this.Page.Form.Attributes["onsubmit"];
                if (!string.IsNullOrEmpty(formOnSubmitAtt) && formOnSubmitAtt == "return _spFormOnSubmitWrapper();")
                {
                    this.Page.Form.Attributes["onsubmit"] = "_spFormOnSubmitWrapper();";
                }
            }
 
 
            ScriptManager scriptManager = ScriptManager.GetCurrent(Page);
            if (scriptManager == null)
            {
                if (Page.Form != null)
                {
                    scriptManager = new ScriptManager();
                    scriptManager.ID = Page.Form.ID + "_ScriptManager";
                    Page.Form.Controls.Add(scriptManager);
                }
            }
 
            if (scriptManager != null)
            {
                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.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.Helpers.DateTime.js", telerikAssembly));
                scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Scheduler.RadSchedulerScripts.js", telerikAssembly));
                scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Scheduler.RecurrenceEditor.RecurrenceEditor.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));
            }
            return scriptManager;
        }    
 
 
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!Page.IsPostBack)
                {
                    CheckScriptManager();
 
                    RadScheduler1.ReadOnly = false;
                    RadScheduler1.AllowEdit = true;
                    RadScheduler1.AllowInsert = true;
 
                    RadScheduler1.StartEditingInAdvancedForm = true;
                    RadScheduler1.StartInsertingInAdvancedForm = true;
                }
            }
            catch (System.Exception ex)
            {
                Logger.SharePointLog.LogEx(ex, "MgmtTimeFrame - PageLoad");
            }
        }
 
 
        /// <summary>
        /// Button to go back to MedRes Admin Menu.
        /// If session has expired, go 1 step backwards.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public void btnMenuLink_Click(object sender, ImageClickEventArgs e)
        {
            string url = "";
 
            if (Session[UsedSessionVarNames.AdminViewMainMenu] != null)
                url = Session[UsedSessionVarNames.AdminViewMainMenu].ToString();
            else
                url = "javascript:history.back();";
 
            Response.Redirect(url);
        }
 
 
        /// <summary>
        /// RadSchedular: Resourcen "Style" verwalten: Treatments = multiple choise, Medic = single choise
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void RadScheduler1_AppointmentDataBound(object sender, SchedulerEventArgs e)
        {
            try
            {
                // TODO: Diese "Farb-Bindung" geht nur bei 1:1 Resourcen; wir haben jetzt 1:n --> wie eine entspr. Farbe auswählen?
                //if (e.Appointment.Resources.GetResourceByType("Behandlung") != null)
                //{
                //  DataRowView x = (DataRowView)e.Appointment.Resources.GetResourceByType("Behandlung").DataItem;
                //  e.Appointment.BackColor = ColorTranslator.FromHtml(x.Row["Color"].ToString());
                //  e.Appointment.ForeColor = Color.Black;
                //}
 
                RadScheduler1.ResourceTypes.FindByName("Treatment").AllowMultipleValues = true;
                RadScheduler1.ResourceTypes.FindByName("Medic").AllowMultipleValues = false;
            }
            catch (System.Exception ex)
            {
                Logger.SharePointLog.LogEx(ex, "RadScheduler1_AppointmentDataBound");
            }
        }
 
 
 
        protected void RadScheduler1_AppointmentCreated(object sender, AppointmentCreatedEventArgs e)
        {
            //Logger.SharePointLog.LogMsgDebug("Entering RadScheduler1_AppointmentCreated");
 
            if (e.Appointment != null && e.Appointment.Resources.Count > 0)
            {
                try
                {
                    List<string> behandlung = new List<string>();
                    foreach(Resource treat in e.Appointment.Resources.GetResourcesByType("Treatment"))
                    {
                        behandlung.Add(treat.Text);
                    }
 
                    if(behandlung.Count > 0)
                    {
                        Label assignedTo = (Label)e.Container.FindControl("lblTreatments");
                        assignedTo.Text = "Behandlung(-en):<br>" + string.Join(", ", behandlung.ToArray());
                    }
 
                    Resource medic = e.Appointment.Resources.GetResourceByType("Medic");
                    if(medic != null)
                    {
                        Label location = (Label)e.Container.FindControl("lblMedic");
                        location.Text = "Arzt: " + medic.Text;
                    }
 
                    e.Appointment.CssClass = "rsCategoryBlue";
                    e.Appointment.BackColor = System.Drawing.Color.PapayaWhip;
                }
                catch (System.Exception ex)
                {
                    Logger.SharePointLog.LogMsgDebug("RadScheduler1_AppointmentCreated -- 1. Exception Schleife");
                    Logger.SharePointLog.LogEx(ex);
                }
 
                // Wenn es ein Appointment im Scheduler gibt, im kleinen Kalender den Tag als "special day" kennzeichnen
                try
                {
                    RadCalendarDay calendarDay = new RadCalendarDay();
                    calendarDay.Date = e.Appointment.Start;
                    calendarDay.IsSelectable = true;
                    calendarDay.ToolTip = e.Appointment.Subject;
                    calendarDay.ItemStyle.CssClass = "rcOrdination";
                    RadCalendar1.SpecialDays.Add(calendarDay);
 
                    RadCalendar SchedulerDetailCalendar = this.RadCalendar1.FindControl("SelectedDateCalendar") as RadCalendar;
 
                    if (SchedulerDetailCalendar != null)
                        SchedulerDetailCalendar.SpecialDays.Add(calendarDay);
                }
                catch(System.Exception ex)
                {
                    Logger.SharePointLog.LogMsgDebug("RadScheduler1_AppointmentCreated -- 2. Exception Schleife");
                    Logger.SharePointLog.LogEx(ex);
                }
            }
 
            //Logger.SharePointLog.LogMsgDebug("Leaving RadScheduler1_AppointmentCreated");
        }
 
 
        /// <summary>
        /// Per default, "all day" event is beeing checked (only) in Month view.  This is the default TELERIK AJAX RadScheduler behaviour.
        /// Here we disable this by manually hooking into the correspondending control (=unchecking the checkbox via code).
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void RadScheduler1_FormCreated(object sender, SchedulerFormCreatedEventArgs e)
        {
            try
            {
                Logger.SharePointLog.LogMsgDebug("RadScheduler1_FormCreated() - entering");
 
                if (e.Container.Mode == SchedulerFormMode.AdvancedEdit || e.Container.Mode == SchedulerFormMode.AdvancedInsert)
                {
                    CheckBox allDayCheckbox = (CheckBox)e.Container.FindControl("AllDayEvent");
                    allDayCheckbox.Checked = false;
                    allDayCheckbox.Style.Add("visibility", "hidden");
 
                    RadDatePicker startTime = e.Container.FindControl("StartTime") as RadDatePicker;
                    if (startTime != null)
                    {
                        startTime.Enabled = true;
                        startTime.Visible = true;
                    }
 
                    RadDatePicker endTime = e.Container.FindControl("EndTime") as RadDatePicker;
                    if (endTime != null)
                    {
                        endTime.Enabled = true;
                        endTime.Visible = true;
                    }
 
                    //Resource medic = e.Appointment.Resources.GetResourceByType("ResMedic");
                    //if (medic != null)
                    //{
                    //    Label location = (Label)e.Container.FindControl("lblMedic");
                    //    location.Text = "Arzt: " + medic.Text;
 
                    //    RadTextBox attrAnnotationsTextbox = (RadTextBox)e.Container.FindControl("ResMedic");
                    //    attrAnnotationsTextbox.Label = "ARZT: ";
                    //}
 
                    //RadTextBox lblMedic = (RadTextBox)e.Container.FindControl("ResMedic");
                    //if (lblMedic != null)
                    //{
                    //    lblMedic.Label = "ARZT: ";
                    //}
 
                    //RadTextBox lblTreatment = (RadTextBox)e.Container.FindControl("ResTreatment");
                    //if (lblTreatment != null)
                    //{
                    //    lblTreatment.Label = "Behandlung: ";
                    //}
 
                    if (e.Container.Mode == SchedulerFormMode.AdvancedInsert)
                    {
                        startTime.SelectedDate = DateTime.Now;
                        endTime.SelectedDate = DateTime.Now.AddHours(2);
                    }
 
                    //try
                    //{
                    //    this.RadScheduler1.ShowAdvancedEditForm(new Appointment());
                    //}
                    //catch(Exception ex)
                    //{
                    //    Logger.SharePointLog.LogEx(ex, "RadScheduler1_FormCreated() -- ShowAdvancedEditForm(new Appointment()) failed");
                    //}
 
                }
                Logger.SharePointLog.LogMsgDebug("RadScheduler1_FormCreated() - leaving.");
            }
            catch (Exception ex)
            {
                Logger.SharePointLog.LogEx(ex, "RadScheduler1_FormCreated()");
            }
        }
 
 
        /// <summary>
        /// Im kleinen RadCalendar wurde ein neues Datum ausgewählt, weiterleiten an den RadScheduler.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void RadCalendar1_SelectionChanged(object sender, Telerik.Web.UI.Calendar.SelectedDatesEventArgs e)
        {
            try
            {
                RadScheduler1.SelectedDate = e.SelectedDates[0].Date;
            }
            catch (System.Exception ex)
            {
                Logger.SharePointLog.LogEx(ex);
            }
        }
 
 
        /// <summary>
        /// Im kleinen RadCalendar wurde ein neues Monat od. Jahr ausgewählt, weiterleiten an den RadScheduler.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void RadCalendar1_DefaultViewChanged(object sender, Telerik.Web.UI.Calendar.DefaultViewChangedEventArgs e)
        {
            try
            {
                RadScheduler1.SelectedDate = RadCalendar1.FocusedDate;
            }
            catch (System.Exception ex)
            {
                Logger.SharePointLog.LogEx(ex);
            }
        }
 
 
        /// <summary>
        /// Render Holidays in the small calendar.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void RadCalendar1_DayRender(object sender, Telerik.Web.UI.Calendar.DayRenderEventArgs e)
        {
            try
            {
                SqlDataSourceCheckHolidays.SelectParameters[0].DefaultValue = e.Day.Date.ToShortDateString();
                DataView view = (DataView)SqlDataSourceCheckHolidays.Select(DataSourceSelectArguments.Empty);
 
                if (view != null)
                {
                    DataTable table = view.ToTable();
                    if (table.Rows.Count > 0)
                    {
                        e.Cell.ToolTip = table.Rows[0]["Name"].ToString();
                        e.Cell.CssClass = "rcWeekend";
                    }
                }
            }
            catch (System.Exception ex)
            {
                Logger.SharePointLog.LogEx(ex);
            }
        }
 
 
        /// <summary>
        /// Wenn das Datum ein Feiertag ist, den Tag zum Bearbeiten sperren.
        /// </summary>
        /// <remarks>
        /// Unbedingt beim TimeSlot +1 Stunde dazu zählen, da das Datum in der Datenbank wegen
        /// Telerik Ctrls um 1 Stunde "verschoben" gespeichert wird.
        /// </remarks>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void RadScheduler1_TimeSlotCreated(object sender, TimeSlotCreatedEventArgs e)
        {
            try
            {
                SqlDataSourceCheckHolidays.SelectParameters[0].DefaultValue = e.TimeSlot.Start.AddHours(1).ToShortDateString();
                DataView view = (DataView)SqlDataSourceCheckHolidays.Select(DataSourceSelectArguments.Empty);
 
                if (view != null)
                {
                    DataTable table = view.ToTable();
 
                    if (table.Rows.Count > 0)
                    {
                        string holidayName = table.Rows[0]["Name"].ToString();
 
                        if (!string.IsNullOrEmpty(holidayName))
                        {
                            e.TimeSlot.CssClass = "Disabled";
                            e.TimeSlot.Control.ToolTip = holidayName;
                        }
                    }
                }
            }
            catch (System.Exception ex)
            {
                Logger.SharePointLog.LogEx(ex);
            }
        }
 
 
 
        /// <summary>
        /// Export a single appointment to iCalendar file
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void RadScheduler1_AppointmentCommand(object sender, AppointmentCommandEventArgs e)
        {
            Logger.SharePointLog.LogMsgDebug("RadScheduler1_AppointmentCommand() -- START.");
            Logger.SharePointLog.LogMsgDebug("Command: " + e.CommandName);
 
            if (e.CommandName == "Insert")
            {
                Logger.SharePointLog.LogMsgDebug(" >>  Command = INSERT");
            }
            else if(e.CommandName == "CmdInsert")
            {
                Logger.SharePointLog.LogMsgDebug(" >>  Command = CmdInsert");
            }
            else if (e.CommandName == "Create")
            {
                Logger.SharePointLog.LogMsgDebug(" >>  Command = Create");
            }
            else if (e.CommandName == "CmdCreate")
            {
                Logger.SharePointLog.LogMsgDebug(" >>  Command = CmdCreate");
            }
 
            Logger.SharePointLog.LogMsgDebug("RadScheduler1_AppointmentCommand() -- END.");
        }
 
    }
}



Any help would be appreciated.

3 Answers, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 20 Dec 2012, 11:52 AM
Hi Haider,

 
One possible reason for such behavior is if you are using RadAjaxManager in the mark up. Please have in mind that in SharePoint we recommend it to be set in the code behind as it is shown in the help topic that you linked.

If it is not the case please share the exact mark up as well so we could inspect it and me more 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
Haider
Top achievements
Rank 1
answered on 27 Dec 2012, 10:42 AM
Have you took just a single look at my posted code?  Just for one single second?

That's exactly what I am doing in CheckScriptManager() that first got called from the Init() event of the SP ApplicationPage.  Since this did not solve the problem I've put the call to CheckScriptManager in the PageLoad() method because somewhere in your forum there was a thread that basicly told "do the manuall loading of the scripts on each post back rather than just on Init()" - without sucess.

You didn't look at the posted code and ask me to post more of it?
Funny...  all right here we go.

<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Page Language="C#" EnableSessionState="True" AutoEventWireup="true" CodeBehind="MgmtDayView.aspx.cs" Inherits="ShareVision.SharePoint2010.MedResWebParts.Layouts.MedResWebParts.MgmtDayView" DynamicMasterPageFile="~masterurl/default.master" %>
 
<asp:Content ID="PageHead" ContentPlaceHolderID="PlaceHolderAdditionalPageHead" runat="server">
    <link rel="stylesheet" type="text/css" href="css/MedResCalendar.css" />
</asp:Content>
 
<asp:Content ID="Content1" ContentPlaceHolderID="PlaceHolderPageTitle" runat="server">
MesRes Verwaltung
</asp:Content>
 
<asp:Content ID="Content2" ContentPlaceHolderID="PlaceHolderPageTitleInTitleArea" runat="server" >
MedRes Verwaltung: Tagesansicht
</asp:Content>
 
<asp:Content ID="Main" ContentPlaceHolderID="PlaceHolderMain" runat="server">
 
            <script type="text/javascript">
                //simple callbac k function for radwindow
                function radWinCallBackFn(arg) {
                    return arg;
                }
 
                //export to excel, word or csv
                function onRequestStart(sender, args) {
                    if (args.get_eventTarget().indexOf("ExportToExcelButton") >= 0 ||
                                        args.get_eventTarget().indexOf("ExportToWordButton") >= 0 ||
                                        args.get_eventTarget().indexOf("ExportToCsvButton") >= 0) {
                        args.set_enableAjax(false);
                    }
                }
            </script>
                          
            <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Metro">
            </telerik:RadAjaxLoadingPanel>
 
            <telerik:RadScheduler ID="RadSchedulerMaster" runat="server" AllowDelete="False" AllowEdit="False" AllowInsert="False" AppointmentStyleMode="Default"
                Culture="de-DE" DataDescriptionField="Description" DataEndField="DtmEnd" DataKeyField="ID" DataRecurrenceField="RecRule"
                DataRecurrenceParentKeyField="RecParentId" DataSourceID="SqlDataSourceMasterOneMonth" DataStartField="DtmStart" DataSubjectField="Name" EnableDescriptionField="True" OnAppointmentCreated="RadSchedulerMaster_AppointmentCreated" ReadOnly="True" SelectedView="MonthView" TimeZoneID="W. Europe Standard Time" EnableDatePicker="False" Height="65px" ShowAllDayRow="False" ShowDateHeaders="False" ShowFooter="False" ShowHeader="False" ShowNavigationPane="False" ShowResourceHeaders="False" ShowViewTabs="False" TimeZoneOffset="01:00:00" Visible="False">
                <MonthView ReadOnly="True" />
            </telerik:RadScheduler>
 
            <div class="main">     
 
                <table border="0" style="width:100%">
                    <tr>
                        <td style="width:320px; vertical-align: top">
 
                            <telerik:RadCalendar ID="RadCalendar1" AutoPostBack="True"  runat="server"
                                OnSelectionChanged="RadCalendar1_SelectionChanged" EnableMultiSelect="False" OnDefaultViewChanged="RadCalendar1_DefaultViewChanged" Skin="Metro" Height="200px" Width="280px">
                                <WeekendDayStyle CssClass="rcWeekend"></WeekendDayStyle>
                                <CalendarTableStyle CssClass="rcMainTable"></CalendarTableStyle>
                                <OtherMonthDayStyle CssClass="rcOtherMonth"></OtherMonthDayStyle>
                                <OutOfRangeDayStyle CssClass="rcOutOfRange"></OutOfRangeDayStyle>
                                <DisabledDayStyle CssClass="rcDisabled"></DisabledDayStyle>
                                <SelectedDayStyle CssClass="rcSelected"></SelectedDayStyle>
                                <DayOverStyle CssClass="rcHover"></DayOverStyle>
                                <FastNavigationStyle CssClass="RadCalendarMonthView RadCalendarMonthView_Metro"></FastNavigationStyle>
                                <ViewSelectorStyle CssClass="rcViewSel"></ViewSelectorStyle>
                            </telerik:RadCalendar>
                        </td>
                         
                        <td style="width:auto; vertical-align:top">
                             
                            <telerik:RadGrid ID="RadGrid1" runat="server" AllowSorting="True" AutoGenerateColumns="False" AutoGenerateEditColumn="True" CellSpacing="0" DataSourceID="SqlDataSourceReservationsMaster" GridLines="None" ShowGroupPanel="True" Skin="Metro" OnDataBound="RadGrid1_DataBound" AllowAutomaticUpdates="True" AllowFilteringByColumn="True" Culture="de-DE">
                                <GroupingSettings CaseSensitive="False" UnGroupButtonTooltip="Hier klicken um Gruppierung aufzuheben." UnGroupTooltip="Herausziehen um Gruppierung aufzuheben." />
                                <ExportSettings ExportOnlyData="True" FileName="MedResExport" IgnorePaging="True" HideStructureColumns="True">
                                    <Excel Format="ExcelML" />
                                </ExportSettings>
                                <ClientSettings AllowDragToGroup="True">
                                </ClientSettings>
                                <GroupPanel Text="Legen Sie eine Spalte via Drag&Drop hier ab um nach dieser Spalte zu gruppieren.">
                                </GroupPanel>
                                <MasterTableView DataKeyNames="ID" DataSourceID="SqlDataSourceReservationsMaster">
                                <CommandItemSettings ExportToPdfText="Export to PDF" ShowAddNewRecordButton="False" ShowExportToCsvButton="True" ShowExportToExcelButton="True"
                                     ShowExportToPdfButton="True" ShowExportToWordButton="True">
                                </CommandItemSettings>
 
                                <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
                                <HeaderStyle Width="20px"></HeaderStyle>
                                </RowIndicatorColumn>
 
                                <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
                                <HeaderStyle Width="20px"></HeaderStyle>
                                </ExpandCollapseColumn>
 
                                    <Columns>
                                        <telerik:GridBoundColumn DataField="ID" DataType="System.Int32" FilterControlAltText="Filter ID column" HeaderText="ID" ReadOnly="True" SortExpression="ID" UniqueName="ID" Visible="false">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn DataField="TimeStart"  FilterControlAltText="Filter TimeStart column" HeaderText="Beginn" ReadOnly="True" SortExpression="TimeStart" UniqueName="TimeStart">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn DataField="TimeEnd" FilterControlAltText="Filter TimeEnd column" HeaderText="Ende" ReadOnly="True" SortExpression="TimeEnd" UniqueName="TimeEnd">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn DataField="PatientNName" FilterControlAltText="Filter PatientNName column" HeaderText="Nachname" SortExpression="PatientNName" UniqueName="PatientNName">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn DataField="PatientVName" FilterControlAltText="Filter PatientVName column" HeaderText="Vorname" SortExpression="PatientVName" UniqueName="PatientVName">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn DataField="TreatmentName" FilterControlAltText="Filter TreatmentName column" HeaderText="Behandlung" SortExpression="TreatmentName" UniqueName="TreatmentName">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn DataField="Medic" FilterControlAltText="Filter Medic column" HeaderText="Arzt" SortExpression="Medic" Groupable="true" UniqueName="Medic">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn DataField="CommentMedic" FilterControlAltText="Filter CommentMedic column" HeaderText="Arzt Kommentar" SortExpression="CommentMedic" Groupable="false" UniqueName="CommentMedic" Visible="false">
                                        </telerik:GridBoundColumn>
                                    </Columns>
 
                                <EditFormSettings EditFormType="Template">
                                    <EditColumn uniquename="EditCommandColumn1"/>
                                        <FormTemplate>
                                            <br/>
                                            Anmerkung Arzt:
                                            <asp:TextBox ID="txtEditDescrArzt" Text='<%#Bind("CommentMedic") %>' TextMode="MultiLine" Rows="5" runat="server" Width="99%" ReadOnly="false" >
                                            </asp:TextBox>
                                            <br/>Sie können zu jeder einzelnen Buchung eine eigene Anmerkung vergeben.<br/><br />                                          
                                            <table border="0" style="width:100%;padding:0px;">
                                                <tr>
                                                    <td style="width:50%; text-align:left">
                                                        <asp:Button ID="btnUpdate" runat="server" CommandName="Update" Text="Speichern" Width="118px" />
                                                    </td>
                                                    <td style="width:50%; text-align:right">
                                                         <asp:Button ID="btnCancel" Text="Abbruch" runat="server" CausesValidation="False" CommandName="Cancel" Width="118px" />
                                                    </td>
                                                </tr>
                                            </table>                                           
                                        </FormTemplate>
                                    <PopUpSettings Modal="true" ScrollBars="None" />
                                </EditFormSettings>
 
                                    <NestedViewSettings DataSourceID="SqlDataSourceReservationsDetail">
                                        <ParentTableRelation>
                                            <telerik:GridRelationFields DetailKeyField="ID" MasterKeyField="ID" />
                                        </ParentTableRelation>
                                    </NestedViewSettings>
 
                                    <NestedViewTemplate>
                                        <asp:Panel ID="NestedViewPanel" runat="server" CssClass="viewWrap">
                                            <div class="contactWrap">
                                                <fieldset style="padding: 10px;">
                                                    <legend style="padding: 5px;">
                                                        <b>Details zur Behandlung von  <%#Eval("PatientVName") %> <%#Eval("PatientNName") %></b></legend>                                                    
                                                 
                                                        <table border="0" style="width:100%; padding: 0px;">
                                                            <tr>
                                                                <td style="width: 20%; text-align: left; vertical-align: bottom;">
                                                                    <asp:Label ID="lblStart" runat="server" Text="Beginn:"></asp:Label>
                                                                </td>
                                                                <td style="width: auto; text-align: left; vertical-align: top;">
                                                                    <asp:TextBox ID="txtStart" Text='<%#Bind("TimeStart") %>' runat="server" Width="140px" ReadOnly="true" >
                                                                    </asp:TextBox>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td style="width: 20%; text-align: left; vertical-align: bottom;">
                                                                    <asp:Label ID="lblEnd" runat="server" Text="Ende:"></asp:Label>
                                                                </td>
                                                                <td style="width: auto; text-align: left; vertical-align: top;">
                                                                    <asp:TextBox ID="txtEnd" Text='<%#Bind("TimeEnd") %>' runat="server" Width="140px" ReadOnly="true" >
                                                                    </asp:TextBox>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td style="width: 20%; text-align: left; vertical-align: bottom;">
                                                                    <asp:Label ID="lblTreatment" runat="server" Text="Behandlung:"></asp:Label>
                                                                </td>
                                                                <td style="width: auto; text-align: left; vertical-align: top;">
                                                                    <asp:TextBox ID="txtTreatment" Text='<%#Bind("TreatmentName") %>' runat="server" Width="100%" ReadOnly="true" >
                                                                    </asp:TextBox>
                                                                </td>
                                                            </tr>      
                                                            <tr>
                                                                <td style="width: 20%; text-align: left; vertical-align: bottom;">
                                                                    <asp:Label ID="lblStorno" runat="server" Text="Storno:"></asp:Label>
                                                                </td>
                                                                <td style="width: auto; text-align: left; vertical-align: top;">
                                                                    <asp:CheckBox ID="chkStorno" Checked='<%#Convert.ToBoolean(Eval("Cancelled")) %>' runat="server" Text='<%#Bind("CancelledText") %>' />
                                                                </td>
                                                            </tr>              
                                                            <tr>
                                                                <td style="width: 20%; text-align: left; vertical-align: bottom;">
                                                                    <asp:Label ID="lblMail" runat="server" Text="Patient eMail:"></asp:Label>
                                                                </td>
                                                                <td style="width: auto; text-align: left; vertical-align: middle;">
                                                                    <table border="0" style="width:100%; padding:0px; border-spacing:0px;">
                                                                        <tr>
                                                                            <td style="padding:0px; border-spacing:0px; text-align:left; vertical-align:top;">
                                                                                <asp:TextBox ID="txtMail" Text='<%#Bind("PatientMail") %>' runat="server" Width="100%" ReadOnly="true">
                                                                                </asp:TextBox>
                                                                            </td>
                                                                            <td style="width:100px; text-align:right; vertical-align:top;">
                                                                                <a href='mailto:<%#Eval("PatientMail") %>?Subject=MedRes Verständigung'>Mail versenden</a>
                                                                            </td>
                                                                        </tr>
                                                                    </table>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td style="width: 20%; text-align: left; vertical-align: bottom;">
                                                                    <asp:Label ID="lblSubj" runat="server" Text="Patient Betreff:"></asp:Label>
                                                                </td>
                                                                <td style="width: auto; text-align: left; vertical-align: top;">
                                                                    <asp:TextBox ID="txtSubj" Text='<%#Bind("Subject") %>' runat="server" Width="100%" ReadOnly="true" >
                                                                    </asp:TextBox>
                                                                </td>
                                                            </tr>  
                                                            <tr>
                                                                <td style="width: 20%; text-align: left; vertical-align: bottom;">
                                                                    <asp:Label ID="lblDescrPatient" runat="server" Text="Patient Anmerkung:">
                                                                    </asp:Label>
                                                                </td>
                                                                <td style="width: auto; text-align: left; vertical-align: top;">
                                                                    <asp:TextBox ID="txtDescrPatient" Text='<%#Bind("CommentPatient") %>' TextMode="MultiLine" Rows="5" runat="server" Width="100%" ReadOnly="true" >
                                                                    </asp:TextBox>
                                                                </td>
                                                            </tr>
                                                        </table>
                                                        <hr />
                                                        <table border="0" style="width:100%; padding: 0px;">
                                                            <tr>
                                                                <td style="width: 20%; text-align: left; vertical-align: bottom;">
                                                                    <asp:Label ID="lblDescrArzt" runat="server" Text="Arzt Anmerkung:">
                                                                    </asp:Label>
                                                                </td>
                                                                <td style="width: auto; text-align: left; vertical-align: top;">
                                                                    <asp:TextBox ID="txtDescrArzt" Text='<%#Bind("CommentMedic") %>' TextMode="MultiLine" Rows="5" runat="server" Width="100%" ReadOnly="true" >
                                                                    </asp:TextBox>
                                                                </td>
                                                            </tr>
                                                        </table>           
                                                        <br />
                                                    </fieldset>
                                                </div>
                                            </asp:Panel>
                                        </NestedViewTemplate>
                                    </MasterTableView>
 
                                    <FilterMenu EnableImageSprites="True"></FilterMenu>
                                    </telerik:RadGrid>
     
                            <br /><br /><br />
                            <asp:Button ID="btnExportExcel" runat="server" OnClick="btnExportExcel_Click" Text="Excel Export"
                                style="background-image:url('/_layouts/images/MedResWebParts/excel_16x16.png'); background-repeat: no-repeat; background-position-x: left; background-position-y:center;" Width="147px" />
                                 
                            <asp:Button ID="btnExportCSV" runat="server" OnClick="btnExportCSV_Click" Text="CSV Export"
                                style="background-image:url('/_layouts/images/MedResWebParts/table_16x16.png'); background-repeat: no-repeat; background-position-x: left; background-position-y:center;" Width="147px" />
                        </td>
                    </tr>
                </table>   
                             
                <asp:SqlDataSource ID="SqlDataSourceMasterOneMonth" runat="server" ConnectionString="<%$ ConnectionStrings:MedResConnectionString %>"
                    SelectCommand="SELECT * FROM [TimeFrame]">
                </asp:SqlDataSource>
 
                <asp:SqlDataSource ID="SqlDataSourceReservationsMaster" runat="server" ConnectionString="<%$ ConnectionStrings:MedResConnectionString %>"
                    SelectCommand="sp_GetReservationsOneDayMaster" SelectCommandType="StoredProcedure"
                    UpdateCommand="UPDATE [Reservations] SET [CommentMedic] = @CommentMedic WHERE [ID] = @ID" UpdateCommandType="Text">
                    <SelectParameters>
                        <asp:SessionParameter Name="Dtm" SessionField="MedResAdminSelectedDateDayView" Type="DateTime" />
                    </SelectParameters>
                    <UpdateParameters>
                        <asp:Parameter Name="CommentMedic" Type="String" />
                        <asp:Parameter Name="ID" Type="Int32" />
                    </UpdateParameters>
                </asp:SqlDataSource>
                <asp:SqlDataSource ID="SqlDataSourceReservationsDetail" runat="server" ConnectionString="<%$ ConnectionStrings:MedResConnectionString %>"
                        SelectCommand="sp_GetReservationsOneDayDetail" SelectCommandType="StoredProcedure">
                    <SelectParameters>
                        <asp:Parameter Name="ID" Type="Int32" />
                    </SelectParameters>
                </asp:SqlDataSource>
 
                <asp:SqlDataSource ID="SqlDataSourceMedics" runat="server" ConnectionString="<%$ ConnectionStrings:MedResConnectionString %>"
                    SelectCommand="sp_RadSchedulerGetMedicsForOneDay" SelectCommandType="StoredProcedure">
                    <SelectParameters>
                        <asp:SessionParameter DefaultValue="1" Name="AppointmentIDs" SessionField="MedResUserViewTimeSlotAppointmentIDs" Type="String" />
                    </SelectParameters>
                </asp:SqlDataSource>
                <asp:SqlDataSource ID="SqlDataSourceTreatment" runat="server" ConnectionString="<%$ ConnectionStrings:MedResConnectionString %>"
                    SelectCommand="sp_RadSchedulerGetTreatmentsForOneDay" SelectCommandType="StoredProcedure">
                    <SelectParameters>
                        <asp:SessionParameter DbType="String" Name="AppointmentIDs" SessionField="MedResUserViewTimeSlotAppointmentIDs" DefaultValue="1" />
                    </SelectParameters>
                </asp:SqlDataSource>
 
            </div>
 
</asp:Content>



0
Helen
Telerik team
answered on 02 Jan 2013, 10:31 AM
Hello Haider,

Do you use RadAjax(RadAjaxManager or RadAjaxPanel) in your master page.  We didn't see any RadAjax declaration on the content page?
If yes - did you try to set the EnableAjax = false of RadAjax and see whether there is a difference?

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