Trapping Arow keys in Datagrid Form
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Trapping Arow keys in Datagrid Form
Hi,
I have a simple data grid form where each row consists of one field.
I want to populate a field, external to the data grid with content, that depends on the row in the data grid that is selected by the mousedown event.
I can do this with the mousedown handler in the row behaviour and it works fine.
But I would also like to do the same thing when a user uses the arrow keys to move up or down the data grid.
Using the arrow keys does what it should, i.e moves up and down the grid BUT how do I trap the arrow key event to do something else as well?
In my case, do the same as is done by the already working mousedown handler.
I have tried an "on arrowkey thekey" handler in the row behaviour.
I have tried a "before arrowkey the key" handler in the row behaviour.
Neither is called (I put a BEEP in them to tell if they are.)
Can I trap the arrow key in the way I want?
I have a simple data grid form where each row consists of one field.
I want to populate a field, external to the data grid with content, that depends on the row in the data grid that is selected by the mousedown event.
I can do this with the mousedown handler in the row behaviour and it works fine.
But I would also like to do the same thing when a user uses the arrow keys to move up or down the data grid.
Using the arrow keys does what it should, i.e moves up and down the grid BUT how do I trap the arrow key event to do something else as well?
In my case, do the same as is done by the already working mousedown handler.
I have tried an "on arrowkey thekey" handler in the row behaviour.
I have tried a "before arrowkey the key" handler in the row behaviour.
Neither is called (I put a BEEP in them to tell if they are.)
Can I trap the arrow key in the way I want?
Re: Trapping Arow keys in Datagrid Form
Hi jameshale,
What happens when you put "on arrowkey thekey" in the dg group script?
Simon
What happens when you put "on arrowkey thekey" in the dg group script?
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: Trapping Arow keys in Datagrid Form
nada.
I tried both "on arrowkey" and "before arrowkey" (the later as I noticed there was a handler deeper in DG for this).
In both cases I inserted both a BEEP and a BREAKPOINT in the hope that I would either hear the handler being actioned or I would stop in the handler and be able to trace.
zilch.
It was as if they were not even there.
I tried both "on arrowkey" and "before arrowkey" (the later as I noticed there was a handler deeper in DG for this).
In both cases I inserted both a BEEP and a BREAKPOINT in the hope that I would either hear the handler being actioned or I would stop in the handler and be able to trace.
zilch.
It was as if they were not even there.
Re: Trapping Arow keys in Datagrid Form
hmmm.
I just added
to the dg group and it's beeping.
Simon
Edit; Not the row but the Custom Control DataGrid (which is a group).
I just added
Code: Select all
on arrowKey tKey
beep
end arrowKey
Simon
Edit; Not the row but the Custom Control DataGrid (which is a group).
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: Trapping Arow keys in Datagrid Form
Solved it.
Seems the handler needs to go into the script of the DG group itself.
Don't quite know why but it works.
Seems the handler needs to go into the script of the DG group itself.
Don't quite know why but it works.
Re: Trapping Arow keys in Datagrid Form
errrr... I said that 
Glad you got it working.
Simon

Glad you got it working.
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: Trapping Arow keys in Datagrid Form
Try to trap "selectionChanged" message. It will work everytime the rów is changed.
Marek
Marek
Re: Trapping Arow keys in Datagrid Form
Sorry Simon.
Didn't see your mention of the group behaviour rather than row behaviour.
When I read it I was probably fixated on "row" and all else was invisible.
However it was probably registered unconsciously as after a while (before checking back to the forum) I looked at the group's behaviour..
So thank you
James
Didn't see your mention of the group behaviour rather than row behaviour.
When I read it I was probably fixated on "row" and all else was invisible.
However it was probably registered unconsciously as after a while (before checking back to the forum) I looked at the group's behaviour..
So thank you
James