Print Page | Close Window

Resync Calendar with DatePicker

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=16057
Printed Date: 12 May 2024 at 2:29am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Resync Calendar with DatePicker
Posted By: AndyWilton
Subject: Resync Calendar with DatePicker
Date Posted: 22 January 2010 at 11:07am
Hi All,
 
I have a scenario where I select various different dates in the DatePicker using the 'Select' method.  The problem is that if the DatePicker is attached to a Calendar, the Calendar is not updating.
 
Eg.  We start with a scenario where both the Calendar and the DatePicker has 1st January highlighted / selected.
I then select 4th, 6th and 10th January on the DatePicker via the 'Select' method.  The DatePicker then has those dates selected BUT the Calendar is still showing the 1st of January.
 
Does anybody know of a method to tell the Calendar to Resync itself with the DatePicker.
 
 
The above obviously works if the DatePicker selections are done via the mouse, but I need to do it via code.
 
Thanks in advance.
 
Andy
 


-------------
Product: Xtreme SuitePro (ActiveX) v11.2.1 -> v15.2.1
Platform: Windows XP / Vista / Win 7
Language: Clarion 5.5 -> C8.x
======================================
Andy Wilton



Replies:
Posted By: mdoubson
Date Posted: 22 January 2010 at 6:11pm
this is working code for MFC app

COleDateTime odt1 = COleDateTime(2009,8,1,0,0,0); COleDateTime odt2 = COleDateTime(2009,9,1,0,0,0);

CXTPDatePickerControl* pDatePicker = &((CMainFrame*) GetParentFrame())->m_dlgDatePicker.m_wndDatePicker;

pDatePicker->SetRange(&odt1, &odt2); pDatePicker->SetSelRange(odt1, odt2);

---- all above you can do in VB
pDatePicker->GetConnection()->SendEvent(XTP_NC_DATEPICKERSELECTIONCHANGED, 0, 0);
----coud you do smth similar in VB?


-------------
Mark Doubson, Ph.D.


Posted By: SuperMario
Date Posted: 25 January 2010 at 10:11am
You can call it, but it won't update still.  Problem is wndDatePicker.Select does not fire wndDatePicker_SelectionChanged:

    wndDatePicker.Selection.AllowNoncontinuousSelection = True
    wndDatePicker.Select "01/20/2010"
    wndDatePicker.Select "01/25/2010"
    wndDatePicker.Select "01/27/2010"
   
    Call wndDatePicker_SelectionChanged


Posted By: mdoubson
Date Posted: 25 January 2010 at 1:51pm
https://forum.codejock.com/uploads/BetaOCX/CalendarBeta14.rar - https://forum.codejock.com/uploads/BetaOCX/CalendarBeta14.rar  
had new function datepicker.ResyncCalendar
 
and also modified function
datepicker.FirstWeekOfYearDays = (say 4 for Germany) to make proper Print / PrintPreview small calendars with week numbers


-------------
Mark Doubson, Ph.D.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net