Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Property Grid
  New Posts New Posts RSS Feed - CXTPPropertyGridItemDate: Having problems changing
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CXTPPropertyGridItemDate: Having problems changing

 Post Reply Post Reply
Author
Message
drisch View Drop Down
Groupie
Groupie


Joined: 06 July 2006
Status: Offline
Points: 16
Post Options Post Options   Thanks (0) Thanks(0)   Quote drisch Quote  Post ReplyReply Direct Link To This Post Topic: CXTPPropertyGridItemDate: Having problems changing
    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
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.172 seconds.