How to get ID of the last exception appointment

3 posts, 0 answers
  1. brian
    brian avatar
    23 posts
    Member since:
    Aug 2008

    Posted 18 Oct 2011 Link to this post

    Hi,

    I have customized implementation of Scheduler and there are some tables in the back end I need to update after appointment dragged and dropped by the user. To have that custom tables update done I need to have newly added ID of exception appointment. To get that ID I handle this event in following way:

      Private Sub RadScheduler1_RecurrenceExceptionCreated(sender As Object, e As Telerik.Web.UI.RecurrenceExceptionCreatedEventArgsHandles RadScheduler1.RecurrenceExceptionCreated
     
            RadScheduler1.DataBind()
            Dim NewAppID As Integer = GetLastAddedAppointmentID(RadScheduler1) 'my own function
     
        End Sub
    
    This is my workaround of what might be a much more straightforward process. 
    Moreover, with that approach there can be some issues with concurrency when more than one user are working
    on the same scheduler.
    
    So the question is what would be better way to extract that newly added ID of exception appointment?
    Please advise.
    
    Thanks!
    
    
    
    
    
  2. brian
    brian avatar
    23 posts
    Member since:
    Aug 2008

    Posted 19 Oct 2011 Link to this post

    Please disregard my question above. I found solution. Insert event of the data source should be handled to get that last added id upon drag and drop of existing recurrent appointment. My data source is LINQ, so I have that handler as follows:

    Private Sub LinqDataSource1_Inserted(sender As Object, 
    e As System.Web.UI.WebControls.LinqDataSourceStatusEventArgsHandles LinqDataSource1.Inserted
       
            Dim result As yourLINQEntity.YourLINQObjects = e.Result
            Dim NewAppID As Integer = result.ID
     
    	(more code here for update of the back end tables)
    
    End Sub


    Thanks!
  3. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 20 Oct 2011 Link to this post

    Hi Brian,

    Thank you for sharing your solution in the forum.

    We are glad that you were able to solve the problem yourself and apologize that we could not help you right away. 

    Don't hesitate to contact us if you have other questions. 

    Best wishes,
    Peter
    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
Back to Top