Run Time Interaction > Navigation and Scrolling > Mouse navigation |
When the user clicks a non-current cell, the grid fires the BeforeRowColChange event. Unless you cancel this event, the clicked cell becomes current and the grid subsequently fires the RowColChange event after any pending update operations have completed. The only exceptions to this are:
If the user clicks a cell in a column or split that has the AllowFocus property set to False, and the cell belongs to the current row, then the current cell does not change.
If the user clicks a cell in a column or split that has the AllowFocus property set to False, and the cell does not belong to the current row, then the current row changes, but the column with the focus retains it.
If the current cell has been modified, and the BeforeColUpdate event is canceled, then the current cell does not change.
If the current row has been modified, and the user clicks a cell in a different row, and the BeforeUpdate event is canceled, then the current cell does not change.
The user can also use the mouse to manipulate the grid's scroll bars, bringing cells that lie outside the grid's display area into view. The vertical scroll bar governs rows; the horizontal scroll bar governs columns. The ScrollBars property controls which scroll bars are displayed, if any.
Scrolling always occurs in discrete cell units; the user cannot scroll on a per-pixel basis in either direction.
Note that the scroll bars do not change the current cell. Therefore, the current cell may not always be visible.
To respond to vertical scrolling operations in code, use the FirstRowChange event. To respond to horizontal scrolling operations in code, use the LeftColChange event.