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

Était-ce utile?

La solution

I guess you can use the following

DBGrid1.DataSource.DataSet.First

Autres conseils

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

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top