Next - cCJGrid
Moves the focus to the next column in the grid when the Tab key is pressed
Type: Procedure
Syntax
Procedure Next
Call Example
Send Next
Description
Moves the focus to the next column in the grid when the Tab key is pressed.
Determining what the "next" column will actually be is complicated process. The grid determines this by sending the message NextColumn to the SelectedColumnObject. It is the job of NextColumn to determine what the next column is based on the current visual column order and the focusability of the columns. In addition to returning the next column object, NextColumn returns a flag that indicates if the navigation will wrap (i.e., if the next navigation will consist of a forward 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 Next event will consist of a row wrap, the logic gets more complicated. You are given the choice to navigate to the next row, wrap within the same row, activate another object, or cancel the navigation. Next 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 Next to do nothing. This provides a way for Next 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.
When navigating into the next row, the method may perform an automatic row append. If you currently adding a new row, through an insert or append operation, Next, after saving the row, will add and enter a new row below this row. If you are editing the last row (even if it is not new) and pbAutoAppend is true, the same behavior will occur. This automatic new record insert behavior makes it easy and intuitive to quickly add new rows through keyboard navigation.
If you wish to move to the previous column, you can send the Previous message, which is what is called when you press the Shift+Tab key.