AndrewMozley
Programmer
I have a grid where I display details of customers that the user might be interested in. These columns are be Account, Name, PostCode, Contact
In my first version I wanted the user to be able to double-click on a row (a customer) to select that customer, and I tried including the relevant code in mygrid.dbclick().
This did not work, because a double-click on a cell is interpreted as just that : The double click does not percolate through to mygrid.dbclick().
So I changed the code to pick it up in mygrid.Column1.text1.DblClick(); and that produces a result - provided that the user double-clicked on the first column.
However, I would still like the user to be able to select a particular customer by some action on any column of the grid. So I put code into mygrid.beforeRowColChange() and tested for LASTKEY() = 13. This works up to a point. The event does indeed occur and I can treat it as selection of the customer.
But if the last action before entering the grid was pressing the <Enter> Key, if I subsequently click (Single click) on a cell, that invokes the BeforeRowColChange() method. And this finds that LASTKEY() was 13 - it has not been affected by the last mouse click.
So my code treats the user's action as the selection of that customer. That is not what I wanted. I only want to treat it as selection of the customer if the user has pressed the <Enter> key while the grid is being displayed.
As always, grateful . . .
In my first version I wanted the user to be able to double-click on a row (a customer) to select that customer, and I tried including the relevant code in mygrid.dbclick().
This did not work, because a double-click on a cell is interpreted as just that : The double click does not percolate through to mygrid.dbclick().
So I changed the code to pick it up in mygrid.Column1.text1.DblClick(); and that produces a result - provided that the user double-clicked on the first column.
However, I would still like the user to be able to select a particular customer by some action on any column of the grid. So I put code into mygrid.beforeRowColChange() and tested for LASTKEY() = 13. This works up to a point. The event does indeed occur and I can treat it as selection of the customer.
But if the last action before entering the grid was pressing the <Enter> Key, if I subsequently click (Single click) on a cell, that invokes the BeforeRowColChange() method. And this finds that LASTKEY() was 13 - it has not been affected by the last mouse click.
So my code treats the user's action as the selection of that customer. That is not what I wanted. I only want to treat it as selection of the customer if the user has pressed the <Enter> key while the grid is being displayed.
As always, grateful . . .