Board index » delphi » TStringGrid - Leaving a Cell

TStringGrid - Leaving a Cell

Hi,

I'm using a delphi-1 string grid. I want the user to make some
modifications to the content of a cell. When the user left the cell
the program should parse that content.

But I don't know, when the user leaves a cell. Currently I use
OnSetEditText and parse the input everytime the user hits a key but
that is inconvenient. I can't distinquish a real format error
from an error caused by the fact the user has not finished his edits.

Is there a way to find out, if a user still is in editor mode?
...or if a user leaves a cell?

Thanks for help

Jens

 

Re:TStringGrid - Leaving a Cell


Quote
On Sun, 18 Jan 1998 21:53:22 +0100, j...@rhein-zeitung.de wrote:
> But I don't know, when the user leaves a cell.

The OnSelectCell event fires when a user leaves the cell. When the
event fires, the Cell and Row properties of the grid represent the
currently selected cell, while the Cell and Row parameters to the
event-handler represent the cell which is being newly selected.

--
Rick Rogers (TeamB) | Fenestra Technologies

Re:TStringGrid - Leaving a Cell


Quote
j...@rhein-zeitung.de wrote:
> I'm using a delphi-1 string grid. I want the user to make some
> modifications to the content of a cell. When the user left the cell
> the program should parse that content.

> But I don't know, when the user leaves a cell. Currently I use
> OnSetEditText and parse the input everytime the user hits a key but
> that is inconvenient. I can't distinquish a real format error
> from an error caused by the fact the user has not finished his edits.

You can use my TStringAlignGrid which has an additional event
OnAfterEdit which fires once the edit for one cell is finished.

Sincerely,
   A.Hoerstemeier

--
SCP GmbH                 |  Andreas Hoerstemeier
 Auf der Huels 120       |  Software Developer
 52068 Aachen            |    email: a...@scp.de            (work)
 Germany                 |           a...@hoerstemeier.de (private)
phone: +49-241-96830-0   |    web:  
http://wwww.westend.de/~hoerstemeier
fax:   +49-241-96830-50  |    ICQ:   1661968
web:   http://www.scp.de |

Re:TStringGrid - Leaving a Cell


Rick Rogers (TeamB) <r...@fenestra.com> wrote in article
<34c26e51.23117...@forums.borland.com>...

Quote
> On Sun, 18 Jan 1998 21:53:22 +0100, j...@rhein-zeitung.de wrote:
> The OnSelectCell event fires when a user leaves the cell. When the
> event fires, the Cell and Row properties of the grid represent the
> currently selected cell, while the Cell and Row parameters to the
> event-handler represent the cell which is being newly selected.

That is a big improvement over what I have been resorting to.
However, the Cell and Row properties of the grid don't behave as
described when the change is to a higher numbered row or column.  In
those cases, both pairs of Row/Col integers point to the newly
selected cell.  It works if you decrease the selection.  Strange.

A workaround I will use is to use only the event handler Row, Col
and manually save the old location.  I will still have to test for
Enter and FormClose to initiate cell string processing, and maybe Tab
as well.

John fistere

Other Threads