Board index » delphi » TStringGrid ....Selection Property

TStringGrid ....Selection Property

I am using Delphi 4 string grid and trapping the return key to make it
behave like the up and down arrow key when inside the grid and moving one
row done each time.  I would like the Cell value to be selected the same as
the behaviour when the up or down arrow key is pressed and the cell contents
are selected. Currently it just enters the cell but doesnt select the
contents.   I have played with the selection property of the string grid but
its not behaving as I would expect.  I currently am trying to use this
selection property within an OnKeyDown event which traps the return key
increments the Row value and trying to select the new Cell but currently
does nothing.

The TstringGrid Options are set appropriately for selecting a cell so I am
currently stuck as to what to try?......SHould I be using the Canvas
property perhaps?

I would appreciate any help in this matter.

 

Re:TStringGrid ....Selection Property


Quote
> I am using Delphi 4 string grid and trapping the return key to make it
> behave like the up and down arrow key when inside the grid and moving one
> row done each time.  I would like the Cell value to be selected the same as
> the behaviour when the up or down arrow key is pressed and the cell contents
> are selected. Currently it just enters the cell but doesnt select the
> contents.   I have played with the selection property of the string grid but
> its not behaving as I would expect.  I currently am trying to use this
> selection property within an OnKeyDown event which traps the return key
> increments the Row value and trying to select the new Cell but currently
> does nothing.

Set the grids EditorMode to true after you moved to the new cell.

Peter Below (TeamB)  100113.1...@compuserve.com)
No e-mail responses, please, unless explicitly requested!

Other Threads