Updating appointments with TableAdapters

5 posts, 0 answers
  1. FB
    FB avatar
    6 posts
    Member since:
    May 2011

    Posted 28 Jun 2011 Link to this post

    Hello,

    I have a form that uses databinding using Dataset/TableAdapter for the Appointments. I have one table - Appointments. If I were to use a button to update the dataset to persist the data, will I still need to hit the "Ok" button before I hit the Update button? I am using the Timeline view and it displays the appointments from table correctly. However, after dragging to new start and end date, I have to select "All day event" then hit Ok and then the update button before my changes are saved.

    What am I doing wrong?



    Thanks.
  2. Ivan Todorov
    Admin
    Ivan Todorov avatar
    688 posts

    Posted 29 Jun 2011 Link to this post

    Hello FB,

    Thank you for your question.

    There is a known issue in RadScheduler with updating the data source when changing appointments' start date via drag and drop. By hitting the 'All Day Event' you force an update of the data item and that is why this saves your changes. We will try to address this issue in the upcoming Q2 release. For the time being, I can only suggest you to change appointments' start date through the appointment edit dialog.

    I hope this helps.

    Best wishes,
    Ivan Todorov
    the Telerik team
    Q1’11 SP1 of RadControls for WinForms is available for download; also available is the Q2'11 Roadmap for Telerik Windows Forms controls.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. FB
    FB avatar
    6 posts
    Member since:
    May 2011

    Posted 29 Jun 2011 Link to this post

    Thanks Ivan,

    Can I not, somehow, make use of the move, resize events if they exist? Check if the start/end dates have changed and save to database?


    Thanks
    FB
  5. Ivan Todorov
    Admin
    Ivan Todorov avatar
    688 posts

    Posted 30 Jun 2011 Link to this post

    Hi Fb,

    I have made some further investigations on this case and I have managed to think of a workaround. It handles the Appointments.CollectionChanged event and updates the appointments manually. The following code snippet demonstrates this:
    AddHandler Me.RadScheduler1.Appointments.CollectionChanged, AddressOf Appointments_CollectionChanged
     
     
    Private Sub Appointments_CollectionChanged(sender As Object, e As Telerik.WinControls.Data.NotifyCollectionChangedEventArgs)
        If e.Action.Equals(Telerik.WinControls.Data.NotifyCollectionChangedAction.Batch) Then
            For i As Integer = 0 To Me.radScheduler1.Appointments.Count - 1
                Dim app As IEvent = Me.radScheduler1.Appointments(i)
                Me.radScheduler1.DataSource.GetEventProvider().Update(app, "Start")
                Me.radScheduler1.DataSource.GetEventProvider().Update(app, "End")
                Me.radScheduler1.DataSource.GetEventProvider().Update(app, "Duration")
            Next
        End If
    End Sub

    The issue will most probably be addressed in the upcoming Q2 release. For the time being, I hope this will help you.

    If you have any further questions, feel free to ask.

    Best wishes,
    Ivan Todorov
    the Telerik team
    Registration for Q2 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting July 18th and book your seat for a walk through all the exciting stuff we ship with the new release!
  6. FB
    FB avatar
    6 posts
    Member since:
    May 2011

    Posted 30 Jun 2011 Link to this post

    Hi Ivan,

    Thanks for your prompt reply. Yes it does! As a matter of fact I made use of the AppointmentMouseUp event. Wrote a function that makes call to the database. This way the appointments are saved everytime they are dragged or moved.

    Regards and looking forward to Q2 release.

    FB
Back to Top
UI for WinForms is Visual Studio 2017 Ready