Clicking on half visivle cell

Hi,
I would like to know if there is a way to block clicks on half visible cells at the bottom of the grid (TAdvStringGrid).

When clicking an half visible cell at the bottom of the grid, if shifts up one position so that the content of the row is visible.

The issue is that when a user double clicks an half visible cell, the double click ends up firing up on the wrong row. I managed to alleviate the problem by setting NoAutoRangeScroll of MouseOptions to true so that autoscroll isn't performed when clicking an half visible cell but I still have the problem.

Thanks

Other than this setting : grid.MouseActions.NoAutoRangeScroll, there is no additional setting to affect this behavior. What exact problem remains for you when you set this to true?

Hi,
I have nailed down the issue.

Inside the OnDblClickCell event, the value of the ARow parameter is different from the Grid.Row value.

Is this by design?

To reproduce simply add an AdvStringGrid to a forn with enough rows so that the grid has a scrollbar.
Add a OnDblClickCellEvent where you will compare the value of ARow and Grid.Row

Run the application and doubleclick on an half visible cell.

Thanks

Just wanted to add that you get the same behavior with the ACol parameter if you have horizontal scrollbars.

What happens here is that when you click a partially visible col / row, the cell gets in focus as a result of this. The first click of the double click causes this and causes the scroll. This means that by the time the 2nd click happens, the cell is scrolled in place, hence, the double click is registered on the next column / row.

I'll take that as a "this is by design" answer.

I'll simply not use the ARow parameter inside the DblClickCell event from now on.

Thanks