Objective Grid: Preventing zeros from being stripped from numeric entries

Article ID: 701
Last updated: 11 Jun, 2018
Article ID: 701
Last updated: 11 Jun, 2018
Revision: 3
Views: 1717
Posted: 12 Jan, 2001
by Meltreger B.
Updated: 11 Jun, 2018
by Meltreger B.

Problem


How can I prevent leading zeros from being stripped off when entering numbers into a grid without formula support?


Cause



Action


When you enter numbers into a cell Objective Grid parses the string and recognizes the value as number. Objective Grid will set a flag in the style object that marks the value as numeric: SetValueType(GX_VT_NUMERIC). Later when the cell is drawn Objective Grid will check the CGXStyle::GetFormat attribute for the cell and if any formatting is specified format the cell accordingly.

In Objective Grid 6.0, the default format in the standard style was set to GX_FMT_GEN. Therefore when you entered numbers into a cell, the cell was later formatted and leading zeros were stripped off even though the value was correctly stored with leading zeros.

In Objective Grid 6.01 we have changed the standard style format to GX_FMT_DEFAULT. This avoids that leading zeros and trailing digits are stripped off.

OG will not try to format cells then by default any more but you are still able to apply formatting to individual cells via SetStyleRange(range, CGXStyle().SetFormat(GX_FMT_…));

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

Others in this category