Board index » delphi » DBGrid: How can I select all ROWS in the DBGrid-object?

DBGrid: How can I select all ROWS in the DBGrid-object?

Hello,

I've got one question about the DBGrid-Object: How can I select multiple or
all rows
(= multiple or all records in the ttable-object)? I want to offer the user
of my program
a button called "select all" - and this button should do the before
mentioned action if it is klicked.

Thank you in advance for every answer!

               Michael Stein

===============================
Michael Stein, D-13187 Berlin
eMail: michael.st...@berlin.snafu.de

 

Re:DBGrid: How can I select all ROWS in the DBGrid-object?


This is an option:

  with dbGrid1.datasource.dataset do
     begin
        disableControls;
        first;
        while not(eof) do
           begin
            dbGrid1.SelectedRows.CurrentRowSelected:=true;
            next;
           end;
        enableControls;
     end;

Greets, Liset

Quote
Michael Stein wrote in message <7ecf5v$cj...@unlisys.unlisys.net>...
>Hello,

>I've got one question about the DBGrid-Object: How can I select multiple or
>all rows
>(= multiple or all records in the ttable-object)? I want to offer the user
>of my program
>a button called "select all" - and this button should do the before
>mentioned action if it is klicked.

>Thank you in advance for every answer!

>               Michael Stein

>===============================
>Michael Stein, D-13187 Berlin
>eMail: michael.st...@berlin.snafu.de

Other Threads