1. Home
  2. Computing & Technology
  3. Delphi Programming

Get the line number of a selected row in a DBGrid

By Zarko Gajic, About.com

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)) ;
~~~~~~~~~~~~~~~~~~~~~~~~~

Delphi tips navigator:
» Is TCP/IP installed?
« Flicker free TImage in Delphi

Explore Delphi Programming

More from About.com

  1. Home
  2. Computing & Technology
  3. Delphi Programming
  4. Coding Delphi Applications
  5. Delphi Tips and Tricks
  6. 2002 Delphi Tips
  7. Get the line number of a selected row in a DBGrid

©2008 About.com, a part of The New York Times Company.

All rights reserved.