Board index » delphi » getting grid field text while editing

getting grid field text while editing

I have a tdbgrid attached via a datasource to a table. When the user inserts
or edits a record I want to be able to capture the value of the field being
edited.

eg The "code" field has a value of AAA. The users types BBB and double clicks.

What variable can I access in the on double click event to return the value
BBB ?

Both table1code.value and grid1.fields[0].text still return AAA.

Any help appreciated.

Kym Wilson
g...@perth.dialix.oz.au

 

Re:getting grid field text while editing


Graphics and Technical Systems wrote:

Quote

> I have a tdbgrid attached via a datasource to a table. When the user inserts
> or edits a record I want to be able to capture the value of the field being
> edited.

> eg The "code" field has a value of AAA. The users types BBB and double clicks.

> What variable can I access in the on double click event to return the value
> BBB ?

> Both table1code.value and grid1.fields[0].text still return AAA.

> Any help appreciated.

Both table1code and grid1.fields[0] point to the same object.
The easiest solution in to use UpdateRecord method, because this method
does not post the changes. After that table1code.value will contain the
correct value.

Hope this helps.
--
-------------------------------------
Robert Cerny - application designer & developer
Neosys Ltd. Ljubljana
Email: robert.ce...@neosys.xrs.si

Other Threads