[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 209
  • Last Modified:

Intercepting INS in TDbGrid

Hi, I have an OnVlick event on by TDBNavigator that gets executes when the user clicks on the Insert button. I want the same code executed when the user hits ins in the TDBGRid. How can I intercept this?

Thank you,

Tom.
0
boardtc
Asked:
boardtc
  • 2
  • 2
1 Solution
 
kretzschmarCommented:
hi tom,

you can use the dbgrid.onkeydown or keyup-event like

procedure TForm1.dbgrid1KeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
  if key = vk_Insert then
    showmessage('Insert');  //here should be your code
end;

or you can trigger the beforeinsert-event of your dataset
(this happens allways (key and nav-button))

meikl
0
 
boardtcAuthor Commented:
Meikl, my thinking cap wasn't on, thank you, please answer to grade. Tom.
0
 
kretzschmarCommented:
well tom,

glad to helped you,
good luck again

meikl ;-)

you've a thinking cap ?
i wished sometimes i have one too :-)
0
 
boardtcAuthor Commented:
ha ha :-)
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now