Print Page | Close Window

CXTPPropertyGridItemDate: Having problems changing

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Property Grid
Forum Description: Topics Related to Codejock Property Grid
URL: http://forum.codejock.com/forum_posts.asp?TID=5237
Printed Date: 28 September 2024 at 4:13am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTPPropertyGridItemDate: Having problems changing
Posted By: drisch
Subject: CXTPPropertyGridItemDate: Having problems changing
Date Posted: 06 October 2006 at 11:16am
Hello,
 
I would like to put a date/time value into a property grid. If I use a CXTPPropertyGridItem, I have the drop-down calendar, but here is the problem.

As long as I only have a date and use the following format, everything works:

m_startDateCtrl = new CXTPPropertyGridItemDate("Start Date",   m_StartingDateTime);

m_startDateCtrl->SetDateFormat("%d-%m-%Y");

But when I try to show the date in the format "06-Oct-2006" as follows:

m_startDateCtrl->SetDateFormat("%d-%b-%Y");

m_startDateCtrl->SetMask("00-LLL-0000", "__-___-____");

The date does indeed show correctly, but now when I change the date in the calendar, the change is ignored in the property cell. It just keeps the old value.

If I try to add a time to my date, such as with the following:

m_startDateCtrl->SetDateFormat("%d-%m-%Y %I:%M %p");

m_startDateCtrl->SetMask("00-00-0000 00:00 LL", "__-__-____ __:__ __");

the value displays properly initially, but if I make changes with the keyboard directly in the property cell (to change the time), the changes are not saved when I leave the cell, but rather revert to the old value.

My two questions are, 1) how can I display a month as an abbreviation (e.g. Oct.) and still be able to edit the field; and 2) how can I display and edit the time along with the date?

Any help would be appreciated.
 
Derek



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