Grid rebind after appointmentdelete

10 posts, 0 answers
  1. Frank
    Frank avatar
    24 posts
    Member since:
    Nov 2010

    Posted 31 May 2011 Link to this post

    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
  2. Plamen
    Admin
    Plamen avatar
    2734 posts

    Posted 03 Jun 2011 Link to this post

    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.

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Frank
    Frank avatar
    24 posts
    Member since:
    Nov 2010

    Posted 07 Jun 2011 Link to this post

    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
  5. Plamen
    Admin
    Plamen avatar
    2734 posts

    Posted 08 Jun 2011 Link to this post

    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.

  6. Lee Nessling
    Lee Nessling avatar
    9 posts
    Member since:
    Aug 2008

    Posted 23 Sep 2011 Link to this post

    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

  7. Veronica
    Admin
    Veronica avatar
    1213 posts

    Posted 29 Sep 2011 Link to this post

    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
  8. pirodex
    pirodex avatar
    2 posts
    Member since:
    Aug 2011

    Posted 11 Nov 2014 Link to this post

    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.







  9. pirodex
    pirodex avatar
    2 posts
    Member since:
    Aug 2011

    Posted 11 Nov 2014 in reply to pirodex Link to this post

    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.


  10. Plamen
    Admin
    Plamen avatar
    2734 posts

    Posted 13 Nov 2014 Link to this post

    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.

     
  11. Frank
    Frank avatar
    24 posts
    Member since:
    Nov 2010

    Posted 02 Dec 2014 in reply to Plamen Link to this post

    I guess we allready found a work around for this, after 3 years :-)

    But, thanks for the answer anyway.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017