Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Calendar
  New Posts New Posts RSS Feed - Refresh Calendar
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Refresh Calendar

 Post Reply Post Reply
Author
Message
bricaro View Drop Down
Newbie
Newbie
Avatar

Joined: 15 February 2018
Location: Austria
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote bricaro Quote  Post ReplyReply Direct Link To This Post Topic: Refresh Calendar
    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.

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.188 seconds.