0
votes

I have a TDbGrid linked to a dataset with rows displayed in this grid.

When scrolling on the grid, it moves the selected row of the dataset, which means that if I want to go at the bottom of the grid, it browse every record and the record behind the grid only appears when I am at the bottom of the grid, The behavior I except is : I want the screen to move but not my record selected ( so the only way to change row would be to click on the row). Have you got any idea on how to do that?

The behaviour that I except is the same as in the 'Object inspector' of the IDE delphi 10.

1
define scrolling on the grid. Using the mouse ? the mousewheel ? the keyboard ? The scrollbars ? - GuidoG
@GuidoG Presumably all of them - same story. - Jerry Dodge
Every kind of scroll does that behaviour, it moves the selected row. - Florian Wident
I wanted to know if he wants to change the behaviour for all scroll methods. I can see his point when scrolling by using the scrollbars - GuidoG
Sorry, it's completely unclear what you want. Suppose the dataset has more rows that the grid does and the selected record in the grid is the first record in the dataset. Then you click the grid's vert scrollbar below its thumb. What's supposed to happen then? The selected row can't move down the grid because the first row has to stay at the top of the grid because there are no records above it. - MartynA

1 Answers

5
votes

This is not possible, the TDBGrid is designed such that it only holds the viewable records in its data buffer. So the selected record must be one in the viewable range. This is to minimize data exchange traffic between the server and the client.