Object Reference > True DBGrid Properties > ExposeCellMode Property |
ExposeCellMode Property
This property controls how the rightmost column reacts when clicked by the user.
TDBGrid.ExposeCellMode= value
Values
Design Time |
Run Time |
0 - Scroll on Select (default) |
dbgScrollOnSelect |
1 - Scroll on Edit |
dbgScrollOnEdit |
2 - Never Scroll |
dbgScrollNever |
Read/Write at run time and design time.
If set to 0 - Scroll on Select (the default), the grid will scroll to the left to display the rightmost column in its entirety. This can be somewhat disconcerting to users who commonly click on the grid to begin editing, as the grid will always shift to the left when the user clicks on the rightmost column.
If set to 1 - Scroll on Edit, the grid will not move when the rightmost column is clicked initially. However, if the user attempts to edit the cell, then the grid will scroll to the left to display the rightmost column in its entirety. This is exactly how Microsoft Excel works and is probably the most intuitive setting.
If set to 2 - Never Scroll, the grid will always leave the rightmost column clipped when clicked, even if the user subsequently attempts to edit the cell. Note that editing may be difficult if only a small portion of the column is visible. The chief reason to use this setting is if you know there will always be enough space available for editing (or if you disallow editing) and you never want the grid to shift accidentally.
Note
The ExposeCellMode property only governs mouse clicks, not keyboard navigation.