TAdvStringGrid OnClick not fired when navigating the grid

After an update (I went from a fairly old version) of TAdvStringGrid I have noticed that the OnClick event is no longer fired when you move around the grid using either the keyboard or when setting the Row or Col properties.

This breaks a behaviour that Delphi componentes have always had, correctly or not. Not only grids but also for example listboxs.

I could see in another question (DBGrid) that this has been considered an error, and it is "fixed" now. But for us that have hundreds of instances of TAdvStringGrid among many applications, and have been relied on this behaviour, it is a quite breaking change. Would it be possible to at least have an option to make the component behave in the standard Delphi way?

I checked this with a default TAdvStringGrid on the form and I cannot see an issue.
The behavior is the same as TStringGrid.
See this recording where OnClick is fired for mouse, keyboard & programmatic setting cell

procedure TForm1.AdvStringGrid1Click(Sender: TObject);
begin
  listbox1.Items.Add('click');
end;

gridclick

So I was a bit quick in writing - you are correct that in most of the cases it does fire. However, it does NOT fire the OnClick when you set the row from code (i.e AdvStringGrid1.Row := 2). It does it for the columns but not for the row.

Is there any fix to get that old behaviour back?

And I also noticed now that it does not fire when using the mouse scroll wheel to move up and down in the grid, something it used to do.

In order not to break applications of other users that count on the current behavior, we will not change this.
As a suggestion, to track change of selected cell, use the event grid.OnSelectCell

I understand you dont want to break compability - unfortunatley that is what happened when this was changed…

Is there a way to download older versions of the sourcecode and components? And also, is there a way to find out in what version the behaviour of OnClick was changed (it was sometimes the last 2-3 years I believe).

If you would know a version nr. we can search if we still have a backup.

If your version history is correct, the change seems to have happened in version v10.8.6.0, so I guess it is version v10.8.5.0 I would want.

Can you explain why you changed the OnClick behaviour so that it does not fire for row changes from code, while it is still fire for column changes? For breaking changes like this it would have been nice to have an option to keep the old behaviour.

Also, I tried using the OnSelectionChanged, but that does not trigger from selection changes from code (by setting AdvStringGrid1.Row value). I also tried OnSelectCell, but at the time when that is triggered the change is not yet reflected in the AdvStringGrid1.Row property.

  1. Programmatic changes should not trigger UI events. When you do programmatic changes, your code knows about changes and can act accordingly and this way, your code can still make the difference between what is happening via the UI and what is happening via code.
  2. We've seen the issue with mouse wheel and OnClick not triggered and have fixed this. The next update will address this.