How to set active cell in TDBGrid?
问题 I want to activate a cell in a TDBGrid by code. By "activate" I mean like the user clicked inside the cell, ready to edit the cell content. How could I do this? Edit: This probably involves two steps: change the currently active cell, then enter edit mode. 回答1: If you mean ‘activate the edit mode for the currently active cell’ , then you should probably do like this: MyDBGrid.EditorMode := True; Activating a particular cell can be done either via SelectedIndex : MyDBGrid.SelectedIndex := 2; {