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
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();
|
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.
|