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

Cancelled Insert/Update causes AdvancedEditForm to reload without data

3 Answers 52 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Rahim Bayjou
Top achievements
Rank 1
Rahim Bayjou asked on 08 Aug 2011, 04:59 PM
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!

3 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 11 Aug 2011, 10:34 AM
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.

0
Rahim Bayjou
Top achievements
Rank 1
answered on 11 Aug 2011, 11:26 AM
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.
0
Kalina
Telerik team
answered on 18 Aug 2011, 11:12 AM
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.

Tags
Scheduler
Asked by
Rahim Bayjou
Top achievements
Rank 1
Answers by
Peter
Telerik team
Rahim Bayjou
Top achievements
Rank 1
Kalina
Telerik team
Share this question
or