Jump to content


Photo

Problem with Tab-Key and a calculated field


  • Please log in to reply
3 replies to this topic

#1 tarnschaf

tarnschaf
  • Members
  • 14 posts

Posted 09 April 2012 - 08:30 PM

Hi,

my customer uses a DB Grid with the keyboard, i.e. switching between fields is done with the TAB key. I set WantTabs := true and it works well.

However, there is a problem. The grid contains one calculated column (the DB calculates a difference of two other fields). When one of the fields used for the calculation is changed, and my customer exits the row by pressing TAB, the active field does not move to the next row, but jumps to the second row. If another column is changed, it works as expected (active field enters the next row).

Do you understand my issue and could you provide help?

Thanks,
Michael

#2 tarnschaf

tarnschaf
  • Members
  • 14 posts

Posted 09 April 2012 - 10:57 PM

Hi,

the problem is caused by the following refresh event handler:


procedure TdataForm.queryAfterPost(DataSet: TDataSet);
begin
// Update auto-fields
query.Refresh;
end;

So I could solve my problem by removing the call to Refresh. I still wonder how it would be possible to get an auto-updated field otherwise?

Michael

#3 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 10 April 2012 - 03:34 AM

Hi Michael,

Can you please, if it doesn't consume much time for you to send me small demo project to I see it.

I am not sure how to reproduce it.

Thank you.
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#4 tarnschaf

tarnschaf
  • Members
  • 14 posts

Posted 13 April 2012 - 12:34 AM

Hi, thanks for the offer. Right now I think the problem could have occured because of a missing "Refresh"-Query.
I will contact you again if I have further problems!

Thanks,
tarnschaf




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users