I have a TDBAdvGrid (v184.108.40.206) in my application. Prior grid versions worked until this version well. Options are [goRangeSelect, goRowSelect] and ShowSelection is False. When there are more then one record showing, it works normal. I can select a row (or more rows) and the OnSelectionChanged event is fired. When there is only one record, nothing happens. No OnSelectionChanged event is fired. Clicking on the leftmost header cell and then on the row with the record it gets selected and the event is fired.
OnSelectionChanged is triggered when the selection changes. When there is only one row in the grid and you have row selection enabled (goRowSelect), the selected row can't change, hence OnSelectionChanged is not triggered.
RowSelectCount is used when disjunct row selection is enabled. If you have no disjunt row selection, the selected row(s) are indicated by grid.Selection.Top -> grid.Selection.Bottom
It is a bug, TDBGrid and other grids don't have this problem, only the latest TAdvDBGrid. Please repeair it !
It is not because ShowSelection = false initially that there isn't a row selected. ShowSelection just controls whether the selected row is displayed in a different color.
If you use disjunct row selection, when you need to use to be notified when a a disjunct row selection happens is the event OnRowDisjunctSelect. This event will be triggered when an unselected row is clicked and from there you can toggle grid.ShowSelection.
I have tried to use your advise but no luck. I have use your ADO DBAdvGrid Selection example as base and set the grid as you said. Just clicking on a row sets de DB indicator to that row, no selection showed up. Clicking a second time on that row shows the whole row selected. SelectedRowCount stays at zero. Clicking a second row when holding down CTRL select that row and leaves the first row untouched. Both rows are now showing selected but SelectedRowCount is 1 (not 2 as I expected) I am really stuck with it !!
The intention of the ADOSelection demo is to demonstrate disjunct selection through the checkbox column. To see disjunct selection without checkboxes, please set grid.PageMode = false and set grid.MouseActions.DisjunctRowSelect = true.
Send you the ADO selection example I have used to demonstrate the problem. It has a DBadvGrid and a DBGrid with rowselection enabled. When I select for example 3 rows, DBAdvGrid shows always one less, ie. 2 rows. DBGrid shows the correct rowselect count, ie. 3 rows. As said before, it is a bug.
We will investigate.
It turned out to be a mistake in your code.