Object Reference > True DBGrid Properties > Alignment Property |
Alignment Property
The Alignment property returns or sets a value that determines the horizontal alignment of the values in a grid column or style object.
object.Alignment= value
Values
Design Time |
Run Time |
0 - Left |
dbgLeft |
1 - Right |
dbgRight |
2 - Center |
dbgCenter |
3 - General (default) |
dbgGeneral |
Read/Write at run time and design time.
For data cells, the setting 3 - General means that text will be left-aligned and numbers will be right-aligned. This setting is only useful in bound mode, where the grid can query the data source to determine the data types of individual columns.
For column headers and footers, the setting 3 - General means that the alignment of the column's data cells should be used. Thus, if a column's data cells, headers, and footers all use general alignment, then the underlying data type determines the alignment for all aspects of the column's display.
Note
At run time, you can use the DisplayAlignment property to determine how general alignment was actually rendered in the grid's display.