Finding the current row in Delphi's TDBGrid

BubbaT picture BubbaT · Mar 23, 2009 · Viewed 15.7k times · Source

Is there a way of finding out which row is current in a TDBGrid?

Answer

Kluge picture Kluge · Mar 23, 2009

I'm not sure if I understand your question, but I'll attempt an answer and maybe you can clarify if this isn't what you are asking.

Since a TDBGrid is tied to a DataSource, the current row is the same as the current row in the data source. You can query the DataSource, either by looking at a primary key value or the RecNo property to determine which record is the current one.