Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
260
Can't get calendars to refresh data
posted

I have a need to refresh calendar information every few minutes (or at least check for changes).  The problem is that I can't find any way to refresh them. I have tried:

calInfo.DataBindingsForAppointments.RefreshData()

followed by a refresh on each of the view and nothing happens.  I updated the datasets, and indeed they are updating.  It just isn't making it to the calendar.

I set up the appointments part with this code:

' Set up data binding for Appointments

Dim appointmentsDataBinding As AppointmentsDataBinding = calInfo.DataBindingsForAppointments

appointmentsDataBinding.AllPropertiesMember = "AllProperties"

 

appointmentsDataBinding.StartDateTimeMember = "StartDateTime"

appointmentsDataBinding.EndDateTimeMember = "EndDateTime"

appointmentsDataBinding.SubjectMember ="Subject"

appointmentsDataBinding.AllDayEventMember ="AllDayEvent"

appointmentsDataBinding.OwnerKeyMember ="OwnerKey"

appointmentsDataBinding.SetDataBinding(dsAppts,"ScheduleAppointments")

appointmentsDataBinding.BindingContextControl =Me

appointmentsDataBinding.BindingContext =Me.BindingContext

 

I reload the dataset in a seperate function:

Private Sub LoadCalendar()

Dim SQL As String

dsAppts = Nothing

SQL ="SELECT * FROM ScheduleAppointments"

Main.db.BuildTable(SQL, dtAppts,"ScheduleAppointments", dsAppts)
' Routine to build a data table and data set

calInfo.DataBindingsForAppointments.RefreshData()

calMonth.Refresh()

calDay.Refresh()

calWeek.Refresh()

End Sub

 

What am I missing?  The data table and the dataset do update to the latest data.

 

  • 53790
    posted

    Hi,

    Have you been able to resolve your issue ? Please send me feedback. If you have any questions, do not hesitate to ask me

    Regards

  • 53790
    posted

    Hello Justin,

    I`m not sure what exactly is your scenario. Could you please take a look at the attached project
    where I am trying to reproduce your scenario, using SQL to get appointments from data base. In my sample I refresh the data every 5 seconds. In the attached file I have a SQL script that create and fills my test table.
    Please take a look at the sample and if you think that there are differences between your scenario and mine project, please feel free to modify it.
    Please if you have any questions, do not hesitate to aks me
    Regards

    WinScheduleRefreshVB.zip
  • 50
    posted

    Hi. We have a similar problem.
    We have to refresh calendar information (appointments) every time we change the data of some
    TextBoxes, that we have acting like filters for the temp-tables linked to the datasets, but we don't know how to refresh the calendar.

    We are using this in the refresh method, but it's not working:

    DATASET dsAppointments:EMPTY-DATASET().
    DATASET dsOwners:EMPTY-DATASET().
    EMPTY TEMP-TABLE tt_appointments.
    EMPTY TEMP-TABLE tt_owners.

    THIS-OBJECT:ultraCalendarInfo1:Reset().
    ...
    bindingSource1:Handle = DATASET dsAppointments:HANDLE.
    bindingSource2:Handle = DATASET dsOwners:HANDLE.
    ...
    THIS-OBJECT:panelCalendar1:DataBindingsForAppointments = bindingSource1.
    THIS-OBJECT:panelCalendar1:DataBindingsForOwners = bindingSource2.

    Thanks.