Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can you count the number of selected items in a DBGrid? 1

Status
Not open for further replies.

PaidtheUmpire

Programmer
Jan 4, 2004
105
AU
I want the code to count the number of rows selected, and display it in the edit1.text field.


DBGrid Name : Grid
 
A quick look at the Delphi Help shows that the SelectedRows property of DBGrid contains the bookmarks of the selected rows and that the Count property of SelectedRows is, well, the count of the number of rows that are selected.

So something like this should be of help:
Code:
  Edit1.Text := IntToStr ( DBGrid1.SelectedRows.Count );

Andrew
Hampshire, UK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top