Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Property Grid
  New Posts New Posts RSS Feed - HowTo: Format Date like this
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

HowTo: Format Date like this

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

Joined: 18 July 2006
Location: Germany
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote Rith Quote  Post ReplyReply Direct Link To This Post Topic: HowTo: Format Date like this
    Posted: 03 August 2006 at 9:11am
Hi.
 
how to make a Date-Format like this: 03.08.2006. In my local-Setting it must show like this sample, but the PropertyGrid shows me like this: 03/08/2006 . In the help-files couldnīt find help...
 
hope you understand my Problem...
 
thx for help
 
Thomas Rith
 
(sorry for my english...)
 
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 03 August 2006 at 11:50am
Hello, call
pItem->SetFormat(T("%d.%m.%Y");
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Rith View Drop Down
Newbie
Newbie
Avatar

Joined: 18 July 2006
Location: Germany
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote Rith Quote  Post ReplyReply Direct Link To This Post Posted: 04 August 2006 at 9:50am

aProperty = aCategorie.AddChildItemBinded(XtremePropertyGrid.PropertyItemType.PropertyItemDate, mObject, "Geburtstag")

aProperty.Caption = "Geburtstag"

aProperty.Description = "Hier bitte das Geburtsdatum eintragen."

aProperty.Format = "%d.%m.%Y"

This is my Code now, but it doesnīt go... ??? !!! Can you help...?
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 04 August 2006 at 10:21am
Hi,
you didn't say about ActiveX and bindings...
 
So just set value again after you change format:
 
aProperty.Value = mObject.Geburtstag
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Rith View Drop Down
Newbie
Newbie
Avatar

Joined: 18 July 2006
Location: Germany
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote Rith Quote  Post ReplyReply Direct Link To This Post Posted: 08 August 2006 at 7:57am
thx, this helps.
Thomas Rith
Back to Top
larrym View Drop Down
Newbie
Newbie


Joined: 30 May 2006
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote larrym Quote  Post ReplyReply Direct Link To This Post Posted: 13 December 2006 at 3:18pm
I'm using VB ActiveX and bindings and am having trouble formatting dates. I used the format suggested above and it 'kind a works'. Dates are show as two digit years. If I use the drop down calendar and select a date it returns 'Invalid Date Time'.
Is there any documentation on valid format strings for the PopertyGrid?
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.265 seconds.