>Hi everyone!
>I'm trying to get a grid to create a new record when a user clicks on a blank space in the grid. I already have a NewItem function to call (which is called from a button to 'add item'). I'm trying to make it a little more intuitive.
>
>Any suggestions are apreciated.
>
>Regards,
>Dave
I´m using this:
- In the rigthmost column of the grid I put a command button with a downarrow icon (this makes the thing intuitive)
- In the click event of the button, put the following code:
THIS.PARENT.PARENT.ALLOWADDNEW = .T.
KEYBOARD "{DNARROW)"
(This adds a new row and let the cursor on the leftmost column in the new record
- In the control of the first (leftmost) column of the grid, in the when event, put the following code:
THIS.PARENT.PARENT.ALLOWADDNEW = .F.
All the user has to do is go to the last column and click (or
) and he´s on the next record.
the user does not appends blanks by pressing down arrow, but still may create various blank records by clicking continuously on the button.
Rather than worrying about many blank records, I discard them when saving.
There´s a better life... Just it´s more expensive!
Cristóbal Manrique M.