Object Reference > True DBGrid Properties > DisplayAlignment Property |
DisplayAlignment Property
Returns the actual rendering of general horizontal alignment.
column.DisplayAlignment
Values
Run Time
0 - Left |
dbgLeft |
1 - Right |
dbgRight |
2 - Center |
dbgCenter |
Read-only at run time. Not available at design time.
When the Alignment property is set to 3 - General, text will be left-aligned and numbers will be right-aligned. If your code needs to determine how general alignment was actually rendered in the grid's display, you can examine the value returned by the DisplayAlignment property.
This property is useful if you want to send formatted data to the printer based upon the grid's layout, or if you want to set the ForegroundPicturePosition member of a column's Style property based upon the actual alignment value.
If general alignment is not specified, then the DisplayAlignment property always returns the same value as Alignment.
Note
Prior to version 6.0, the Alignment property of a Column object always returned the display result (left, right, or center) when queried in code, even if explicitly set to 3 - General. In version 6.0, the Alignment property always returns its assigned value, and the DisplayAlignment property returns the display result.