Previous - cCJGrid
Moves the focus to the previous column in the grid when the Shift+Tab key is pressed
Type: Procedure
Syntax
Procedure Previous
Call Example
Send Previous
Description
Moves the focus to the previous column in the grid when the Shift+Tab key is pressed.
Determining what the "previous" column will actually be is complicated process. The grid determines this by sending the message PreviousColumn to the SelectedColumnObject. It is the job of PreviousColumn to determine what the previous column is based on the current visual column order and the focusability of the columns. In addition to returning the previous column object, PreviousColumn returns a flag that indicates if the navigation will wrap (i.e., if the previous navigation will consist of a backwards row change).
If there is no row wrap, an attempt will be made to navigate to the appropriate column in the selected row. This generates the standard column change events.
If the Previous event will consist of a row wrap, the logic gets more complicated. You are given the choice to navigate to the previous row, wrap within the same row, activate another object, or cancel the navigation. Previous will call the event OnWrappingRow, which will return, by reference, a wrapping flag and a cancel flag. By default, a row change is allowed. If the wrap flag is set to false inside of OnWrappingRow, the navigation will stay within the row. If the cancel flag is set, the navigation is cancelled. Within OnWrappingRow, you can choose to handle the navigation youself, such as navigating to a different row or column or activating a different object. If you do this, you should set the cancel flag to inform Previous to do nothing. This provides a way for Previous navigation to span across objects. For example, in a cDbCJGrid you may want the Tab key to navigate from the last row in a column to a cDbTextEdit object that contains a text edit for the current row..
If you wish to move to the next column, you can send the Next message, which is what is called when you press the Tab key.