Print Page | Close Window

Refresh Calendar

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Calendar
Forum Description: Topics Related to Codejock Calendar
URL: http://forum.codejock.com/forum_posts.asp?TID=23571
Printed Date: 04 April 2020 at 10:35pm


Topic: Refresh Calendar
Posted By: bricaro
Subject: Refresh Calendar
Date Posted: 15 February 2018 at 10:18am
Hello,

I am a complete newbie, so please forgive me, if I'm asking something fairly simple. I am using the SQLServerDataProvider sample for MFC of Xtreme ToolkitPro v18.2.0. What I want to do is, implement a menu command to refresh the data of the calendar control. So the control shall read the latest data from the database. I tried to call:

CXTPCalendarControl& control =  GetCalendarCtrl();
control.Populate();

and

CXTPCalendarControl& control =  GetCalendarCtrl();
control.Populate();
control.RedrawControl(1);

but no method of the custom data provider gets called. It seems the control doesn't even attempt to reread data from the database, and I don't understand why that is.  Can someone please point me into the right direction of what I am doing wrong or on how to get the control to do the update?

Thank you in advance and regards
Brigitte

Big smile UPDATE:
Ok, in the meantime I found that the control didn't reread the data, because it was reading from cache obviously. After setting the cache mode to "off" before calling populate, it worked as expected:

CXTPCalendarData* data = GetCalendarCtrl().GetDataProvider();
data->SetCacheMode(xtpCalendarDPCacheModeOff);
GetCalendarCtrl().Populate();

Question Another question regarding this: Is there a way to use the cache, but still force the control to reread from database when I need it? I feel like the various other cache modes are also not sufficient. Thx.




Print Page | Close Window