illogical SelectCell results

I am having problems understanding the Row and Col results I get when I select a range of cells in an AdvStringGrid. 
If I monitor the ARow & ACol values from the OnSelectCell event I get the expected results when I just click in a cell. However if I monitor the Grid.Row/Col, Grid.SelectedRow/ColCount properites or select a range of cells using Shift-click the results seem illogical to me:

The Grid.Row / Grid.Col, Grid.SelectedRow / Grid.SelectedColCount and Grid.Selection properties are changed to the position of the cell or size of block that has just been left.  
All seven properties/values are only updated when Shift is not used. 

e.g. Click @ 0,0 then Shift-click @ 2,2: ARow & ACol are 0,0; the others are still for the cell clicked before 0,0. Click @ 1,1: Arow & ACol are now 1,1, .Row & .Col are 0,0 and .SelectRow/ColCount are 3,3  

Am I doing something wrong? I have tried this with a very simple test app with everything in it's default state so I don't think it can be some odd setting I have messed up. 

How can I get the current range of a cell selection when I Shift-click at the end of the range?

Ok, I have found a solution. (it is always better to code at 10:00 than 02:00!). I need to use the OnClickCell event, not the OnSelectCell event. That does update the Selection as expected.

However, I suppose the original question remains: why the odd values when I use OnSelectCell?
Hi David,

As I understand it, OnSelectCell is called BEFORE the cell is actually selected, so Grid.Row/Col etc will still have the 'old' values. And you can in fact stop the selection of this new cell by setting CanSelect to FALSE in the OnSelectCell event.

Hope that helps?


Hi Steve,

That certainly matches the results I have seen. I suppose it's really a matter of semantics, it would probably be more accurate to call it something like "OnBeforeSelectCell" but that is just getting cumbersome!