Cancelled Insert/Update causes AdvancedEditForm to reload without data

4 posts, 0 answers
  1. Rahim Bayjou
    Rahim Bayjou avatar
    2 posts
    Member since:
    Apr 2008

    Posted 08 Aug 2011 Link to this post

    Hi,

    I am using this server side sample code to prevent appointments from overlapping:

    http://demos.telerik.com/aspnet-ajax/scheduler/examples/limitconcurrentappointments/defaultcs.aspx

    The problem I am trying to solve is this. If an operation is cancelled using the code above, the advanced edit form redisplays as expected but contains no data. In addition, the Save and Cancel buttons have no text in them, and the title bar of the window is also blank. It's possible to re-enter the data into the blank controls, and save the changes by clicking the blank Save button, but clearly this isn't a situation acceptable to a user.

    The control is being hosted in a Sharepoint Visual Web Part, and I have taken measures in the hosting web part to ensure that the ScriptManager provided by Sharepoint is replaced by the RadScriptManager. The FormsCreated event is fired when the form is first shown, but does not execute again for the redisplay of the form following the event cancellation by the server side code.

    Has anyone encountered this issue. My suspicion was the Sharepoint ScriptManager, but now that I'm ensuring that the RadScriptManager is in its place have run out of ideas.

    Your help is appreciated!
  2. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 11 Aug 2011 Link to this post

    Hello Rahim,

    That is strange indeed. Can you try removing the client script registration from the AppointmentInsert handle and check if this makes a difference?
    protected void RadScheduler1_AppointmentInsert(object sender, Telerik.Web.UI.SchedulerCancelEventArgs e)
           {
               if (ExceedsLimit(e.Appointment))
               {
                   Label1.Text = "Another appointment exists in this time slot.";
                   e.Cancel = true;
     
                   ScriptManager.RegisterClientScriptBlock(this, GetType(), "LabelUpdated",
                       "$telerik.$('.lblError').show().animate({ opacity: 0.9 }, 2000).fadeOut('slow');", true);
               }
           }


    Best wishes,
    Peter
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  3. Rahim Bayjou
    Rahim Bayjou avatar
    2 posts
    Member since:
    Apr 2008

    Posted 11 Aug 2011 Link to this post

    Peter,

    Thanks for replying.

    Removing the client script registration did not solve the problem unfortunately.

    The main problem for me is the cancellation of the update. It is the most likely scenario where a user might change the start and end time and then cause an overlap.
  4. Kalina
    Admin
    Kalina avatar
    918 posts

    Posted 18 Aug 2011 Link to this post

    Hello Rahim,

    It is known that under SharePoint every IScript control or control that uses scripts loaded via Ajax Request has issues.
    I will suggest you load the scripts that RadScheduler uses manually at OnPreRender event.
    Please find more details about this approach here.
    I hope this helps.

    All the best, Kalina
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Back to Top