Objective Grid: Date stored in grid does not match CGXDateTime custom format

Article ID: 260
Last updated: 11 Jun, 2018
Article ID: 260
Last updated: 11 Jun, 2018
Revision: 3
Views: 2104
Posted: 23 Jan, 2001
by Meltreger B.
Updated: 11 Jun, 2018
by Meltreger B.

Problem


I am using a custom format with the date/time control. However, when I look at the value that is stored in the grid, it is still the standard date format. Why is that, and how can I get the correctly formatted date?


Cause



Action


The value stored in the style is not in the custom format. Our sample code in gridapp (OG 5.0) is a bit misleading here. We fixed that sample in our 5.01 and 6.0 version.

CGXDateTimeCtrl stores the value in the standard format, but the custom format is displayed in the cell.

You can convert the value from standard format to custom format (that is displayed in the cell) when you call:

CGXDateTimeCtrl* pControl = (CGXDateTimeCtrl*) GetControl(nRow, nCol);
CGXStyle style;
ComposeStyleRowCol(nRow, nCol, style);
pControl->GetControlText(strDisplay, nRow, nCol, NULL, style);

This article was:   Helpful | Not helpful
Report an issue
Article ID: 260
Last updated: 11 Jun, 2018
Revision: 3
Views: 2104
Posted: 23 Jan, 2001 by Meltreger B.
Updated: 11 Jun, 2018 by Meltreger B.

Others in this category