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

Grid rebind after appointmentdelete

9 Answers 77 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Frank
Top achievements
Rank 1
Frank asked on 31 May 2011, 12:33 PM
Hello,

I have implemented a radscheduler with a grid and drag/drop functionality much like your sample here:
http://demos.telerik.com/aspnet-ajax/scheduler/examples/draganddropintegration/defaultcs.aspx?product=scheduler

The only difference is I don't bind the grid with a datasource but in the onneeddatasource event in code behind.
Everything is working great exept that when I delete an appointment I want the grid to rebind because the deleted item should reappear in the grid.

On which event do I call the Rebind event of the grid? I tried the AppointmentDelete but it seems to be to early.

Thanks,

Frank

9 Answers, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 03 Jun 2011, 04:27 PM
Hello Frank,

We tested the demo locally by handling AppointmentDelete like this, but we couldn't reproduce the problem :
protected void RadScheduler1_AppointmentDelete(object sender, AppointmentDeleteEventArgs e)
       {
           int id = (int)e.Appointment.ID;
           DateTime dueDate = DateTime.Now;
           if (!string.IsNullOrEmpty(e.Appointment.Attributes["Due"]))
               dueDate = Convert.ToDateTime(e.Appointment.Attributes["Due"]);
           string priority = "Medium";
           if (!string.IsNullOrEmpty(e.Appointment.Attributes["Priority"]))
               priority = e.Appointment.Attributes["Priority"];
           UnscheduleAppointment(id, dueDate, priority);
           //RadScheduler1.Rebind();
           RadGrid1.Rebind();
           RadAjaxManager1.AjaxSettings.AddAjaxSetting(RadScheduler1, RadGrid1);
       }

Can you send us the code of your implementation? If possible, I suggest you open a support ticket and attach a simple working sample of the issue.

Greetings,
Plamen Zdravkov
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
Frank
Top achievements
Rank 1
answered on 07 Jun 2011, 09:32 AM
Hi Plamen,

The big difference is that I am using my own custom Schedulerprovider.
So if i do something like this:

protected void rsSchedulerWithProvider_AppointmentDelete(object sender, AppointmentDeleteEventArgs e) {
    rgInplannen.Rebind();
}

The rebind of the grid is done before the delete.

And in my provider I ofcourse can't access my grid. I guess I need a appointmentdeleted event but that unfortunately doesn't exist.

Hopefully I made clear what my problem exactly is.

Thanks,

Frank
0
Plamen
Telerik team
answered on 08 Jun 2011, 03:56 PM
Hi Frank,

We inspected the problem once again but we could not reproduce it. Can you send us a simple working demo via a support ticket,  that we can test locally?
 
All the best,
Plamen Zdravkov
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
Lee Nessling
Top achievements
Rank 1
answered on 23 Sep 2011, 08:42 PM
I'm seeing the same thing here.  The Appointment Delete triggers for before the "Delete" method i nthe ScheduleProviderBase.

   void WorkFlowScheduler_AppointmentDelete(object sender, AppointmentDeleteEventArgs e)
{
      // rebind the grid
       TaskGrid1.Rebind();
 }


SchedulerProviderBase

public override void Delete(RadScheduler owner, Appointment appointmentToDelete)
   // Delete the Appointment

0
Veronica
Telerik team
answered on 29 Sep 2011, 07:45 AM
Hello Lee,

Could you provide us with some more information about the case and what should I change in the Drag and Drop demo in order to observe the issue because I could not so far.

All the best,
Veronica
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
pirodex
Top achievements
Rank 1
answered on 11 Nov 2014, 07:38 AM
Hello,

This problem is continuing when u delete appointment which scheduler implements custom schedulerprovider.
The Appointment Delete triggers for before the "Delete" method i nthe ScheduleProviderBase
And u can't refresh grid when delete completed.

 void Scheduler_AppointmentDelete(object sender, AppointmentDeleteEventArgs e)
{
      // rebind the grid
       TaskGrid1.Rebind();
 }

SchedulerProviderBase

public override void Delete(RadScheduler owner, Appointment appointmentToDelete)
   // Delete the Appointment

How can i rebind grid when delete complete and which event ?

Thanks.







0
pirodex
Top achievements
Rank 1
answered on 11 Nov 2014, 07:43 AM
You can repro using this custom provider and after delete appointment try rebind grid.
http://www.telerik.com/support/code-library/radscheduler-web-api-binding
You will see the AppointmentDelete called before provider delete.


0
Plamen
Telerik team
answered on 13 Nov 2014, 11:52 AM
Hi,

Yes indeed the server side event AppointmentDelete is not thrown in case of webService binding because in this case there is no post back when the appointment is deleted. In such case you can use the client OnClientAppointmentWebServiceDeleting event and perform an ajax request to rebind the Grid.

Hope this will explain the issue.

Regards,
Plamen
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Frank
Top achievements
Rank 1
answered on 02 Dec 2014, 08:59 AM
I guess we allready found a work around for this, after 3 years :-)

But, thanks for the answer anyway.
Tags
Scheduler
Asked by
Frank
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Frank
Top achievements
Rank 1
Lee Nessling
Top achievements
Rank 1
Veronica
Telerik team
pirodex
Top achievements
Rank 1
Share this question
or