ActivateCell
This method lets you change which cell has the focus in a grid.
Usage |
grdGrid.ActivateCell( nGridRow, nGridColumn ) |
You can activate a cell in any column that's visible or to the right of the visible portion (if there are six columns, but only the first four are visible, you can pass 6 as nGridColumn). Rows work similarly; you can activate a cell in any row that's visible or below the visible portion. It will activate the cell, but you can't guarantee if the active column is the first or last column displayed, if it's somewhere in the middle, or even if it's displayed (if the cell is not in the viewing area, it is activated, but the display does not scroll to display it). You can't go backward from the visible portion of the grid. A negative number is ignored for either parameter, leaving you on the same cell. |
Example |
* This fails to find the first visible field of the * first record in the display: Thisform.grdMyGrid.ActivateCell(1,1) * To activate the very first column of the first record in * the table, try this: LOCATE && the better GO TOP Thisform.grdMyGrid.Column1.SetFocus() |
See Also |