Why when you use a table as the RecordSource in a grid the numeric fields are left-aligned and the leading zeros truncated whereas if you use a cursor the fields are right-aligned
That's not the case. Do you have the default setup of browse windows showing fields with a nonproportional font, eg courier new? In grids the default font differs, but by default numeric fields are right-aligned in grids. And there is no such thing as leading zeros in numeric fields unless you define a Format and/or inputmask to show such a thing. By default leading zeros are truncated.
What you see in a browse may be preformatted and configured and these settings are stored in the foxuser.dbf so you see the same tables with the same formattings and field and column widths etc. This is done for browse windows, not for grids. You need to customize a grid like you need to customize a browse and this is then stored in the SCX or form class, not in the foxuser.dbf. But by default both a browse and a grid show the same behavior in regard to numeric vs character fields.
In addition, if you create a grid by dragging from the data environment or the project manager, the columns will "inherit" the properties of the corresponding fields in the DBC. That includes things like format and input mask settings.
That's never the case with cursors. So, for that reason, grids based on cursors will always have the default settings unless you explicitly alter them in form/class designer.
Carolx, I suggeset you use the form/class designer to review the properties of the columns in question (and the controls within the columns). You'll probably see the setting that is causing this behaviour.
Mike
__________________________________
Mike Lewis (Edinburgh, Scotland)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.