Question

I am having an issue in setting the active row of DBGrid control.

My dataset has more entries than the visible row count in the DBGrid and I want to set the active row to the first row in the entire grid (not just the top of the visible row set).

I tried using DBGrid.SetActiveRow method, but it is only setting the active row within the visible set of rows in the grid which has scrolled down since my dataset is large.

How can I set the active row to the top of the full grid (not just the visible grid)?

I am using Delphi6.

Thanks

Was it helpful?

Solution

I guess you can use the following

DBGrid1.DataSource.DataSet.First

OTHER TIPS

If you select the first record in your dataset (e.g. MyDataset.First), your DBGrid will synchronise to match.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top