Board index » delphi » getting value in DBGrid cell before leaving cell

getting value in DBGrid cell before leaving cell

I have a DBGrid in which my users enter part numbers. If the user does not
know the part number, I have a part number lookup function which pops up a
window and allows the user to start typing a part number, and, as they type,
zeroes in on the closest matching part number. This all works well.

However, my users are requesting that I allow them to begin typing a part
number in the DBGrid and *then* activate the lookup function. In order to do
this, I need to pass the characters that have been already been typed in to
the lookup function. I can't figure out how I can access these characters in
order to pass them to the function.

 

Re:getting value in DBGrid cell before leaving cell


Check the TIs for things related to 'Dynamic List Box' 'matching user
input'.
You will have to send a Windows Msg to the List Box from the Edit.Text code.
(Actually POSTMessage will be safer)

Quote
"Frank Marousek" <fra...@mcleodusa.net> wrote in message

news:3bead134$1_1@dnews...
Quote
> I have a DBGrid in which my users enter part numbers. If the user does not
> know the part number, I have a part number lookup function which pops up a
> window and allows the user to start typing a part number, and, as they
type,
> zeroes in on the closest matching part number. This all works well.

> However, my users are requesting that I allow them to begin typing a part
> number in the DBGrid and *then* activate the lookup function. In order to
do
> this, I need to pass the characters that have been already been typed in
to
> the lookup function. I can't figure out how I can access these characters
in
> order to pass them to the function.

Re:getting value in DBGrid cell before leaving cell


Quote
>Frank Marousek wrote:

> However, my users are requesting that I allow them to begin typing a
> part number in the DBGrid and *then* activate the lookup function. In
> order to do this, I need to pass the characters that have been already
> been typed in to the lookup function.

Surface the InplaceEditor property of TCustomGrid by declaring a
cracker class:

  type
    TCrackGrid = class(TDBGrid);
  .
  s := TCrackGrid(DBGrid1).InplaceEditor.Text;
________
Andreas
Delphi 5.01 Pro, Win2K Sp2

Re:getting value in DBGrid cell before leaving cell


Exactly what I was looking for... thanks Andreas!
Quote

> Surface the InplaceEditor property of TCustomGrid by declaring a
> cracker class:

>   type
>     TCrackGrid = class(TDBGrid);
>   .
>   s := TCrackGrid(DBGrid1).InplaceEditor.Text;

Other Threads