I have defined hover buttons, which suit my application excellently, and they work well until you click one of them. At this point the aRow parameter is always 1 in the HoverButtonClick event, which renders the feature useless.
I have tried setting the undocumented MoveActiveRow parameter both true and false, since this seems in the source to control saving a row value, but neither setting makes any difference. I have ShowSelection set to false, all the columns except the first (which has a checkbox) return CanEdit false, and I am using 7.6.0.0 with XE2. There is an immovable dotted box around cell [0,1] in my grid (which I would really like to suppress) and I assume this is why the aRow is always 1. The grid has one fixed header row.
What is the purpose of MoveActiveRow?
I have added a temporary kludge in AdvGrid to save the row value in a global variable when the ButtonForm is displayed, and this has enabled me to continue work, though is not ideal.
How to reproduce this?
I have set up the hover buttons with the object inspector, not in code, but I don't think this matters.
I have made a simple project and will send it if you still cannot reproduce the problem. When I set canedit=false unconditionally in CanEditCell, ARow is the SELECTED row if I click in a cell before clicking the button, even if the button is then on another row. When I also set canselect=false unconditionally in SelectCell, Arow is always 1.
I am using a grid to display data, but not to edit it (except the checkboxes in the first column, which sets canedit=true in my real program). The hoverbutton feature is ideal to float an 'edit' and 'delete' button as the cursor moves over the grid, but I do not want the user to be able to select a cell. So I need the event to provide the CLICKED button row, not the selected row. I cannot see why it should ever return the selected row, because its hovering nature (and the documentation) implies that its purpose is to float and only return the row on which it is clicked.
With a default grid and listbox on the form and the code:
It would be more efficient to send a sample source project with detailed steps to reproduce this rather than having us do guesswork and trial & error.
No problem, on the way...