Bathiya Priyadarshana
Bathiya Priyadarshana

Reputation: 1405

Delphi DBGrid SetActiveRow only sets visible rows

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

Upvotes: 0

Views: 1137

Answers (2)

Andy_D
Andy_D

Reputation: 2350

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

Upvotes: 0

Tupel
Tupel

Reputation: 318

I guess you can use the following

DBGrid1.DataSource.DataSet.First

Upvotes: 1

Related Questions