boardtc
asked on
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.
Thank you,
Tom.
ASKER
Meikl, my thinking cap wasn't on, thank you, please answer to grade. Tom.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
ha ha :-)
you can use the dbgrid.onkeydown or keyup-event like
procedure TForm1.dbgrid1KeyDown(Send
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