Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Calendar
  New Posts New Posts RSS Feed - Force refresh calendar view with new external data
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Force refresh calendar view with new external data

 Post Reply Post Reply
Author
Message
reinaldo View Drop Down
Newbie
Newbie


Joined: 13 January 2011
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote reinaldo Quote  Post ReplyReply Direct Link To This Post Topic: Force refresh calendar view with new external data
    Posted: 01 April 2017 at 11:45am
Hello;

How can I force a refresh of the current calendar view if data has been externally modified?  

Let's say I go and manually make changes to the table holding calendar events while the calendar is open on another workstation.  I have ways to alert the app about the need to re-read data and refresh via a database notification.  That part is not the problem.  My question is, once the app receives the notification and thus it is aware that it needs to display new data, how can I tell the calendar control to re-read events from the data source and re-draw the calendar with the new externally modified data?

So far I've been trying with oCal:Populate() followed by oCal:RedrawContorl(), but that doesn't do anything.

Please help.   Thank you,


Reinaldo.
Back to Top
reinaldo View Drop Down
Newbie
Newbie


Joined: 13 January 2011
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote reinaldo Quote  Post ReplyReply Direct Link To This Post Posted: 02 April 2017 at 5:29pm
I figure it out.  In case it helps others here is the answer.  First you need to find the event from the events collection for the given day:
oEvents = oCalendar:DataProvider:RetrieveDayEvents( dDate ) 
Now you need to find the particular event that was changed by looping through the events list while comparing some field that you know is unique.  Once you find the event it needs to be changed on the calendar control:
oCalendar:DataProvider:ChangeEvent( oEvents:Event( n ) )
Or removed if the event was deleted:
oEvents:Remove( n )
I hope that helps others in the future.

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.184 seconds.