Get the line number of a selected row in a DBGrid

If you want to get the line number of a selected row in a DBGrid component, here’s what to do… Note: just substitute the Table1 component for whatever dataset you are using to provide data to your DBGrid.

~~~~~~~~~~~~~~~~~~~~~~~~~
ShowMessage(IntToStr(Table1.RecNo)) ;
~~~~~~~~~~~~~~~~~~~~~~~~~