Solved

DBGrid Select

Posted on 2000-05-16
5
307 Views
Last Modified: 2010-04-04
How do you select all rows in the DBGrid?

In stringgrid, you just press Ctrl,Shift and click the top then click the bottom.  

I can't do the same in DBGrid..

thanks , hope you can help me
0
Comment
Question by:allio
  • 2
  • 2
5 Comments
 
LVL 27

Expert Comment

by:kretzschmar
ID: 2813713
hi allio,

you must bookmark all records for this effect.

meikl
0
 
LVL 17

Accepted Solution

by:
inthe earned 100 total points
ID: 2813786
Hi,
here is how i done it ,enable multiselect (in dbgrid options) you can do below code on double click to selectall then.
(where orders is table1)
procedure TForm1.DBGrid1DblClick(Sender: TObject);
begin    
orders.DisableControls;
    try
      orders.First;
      while not orders.EOF do begin
DBGrid1.SelectedRows.CurrentRowSelected := True;
      orders.Next;
      end;
finally
      orders.EnableControls;
    end;
  end;

hi meikl ,
does bookmark the records mean you can use the stringgrid keystrokes then?
or still have to write seperate code for it?
0
 
LVL 17

Expert Comment

by:inthe
ID: 2813787
Hi,
here is how i done it ,enable multiselect (in dbgrid options) you can do below code on double click to selectall then.
(where orders is table1)
procedure TForm1.DBGrid1DblClick(Sender: TObject);
begin    
orders.DisableControls;
    try
      orders.First;
      while not orders.EOF do begin
DBGrid1.SelectedRows.CurrentRowSelected := True;
      orders.Next;
      end;
finally
      orders.EnableControls;
    end;
  end;

hi meikl ,
does bookmark the records mean you can use the stringgrid keystrokes then?
or still have to write seperate code for it?
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 2814146
hi barry,

you've to write it separate,
would be too nice ;-))

meikl
0
 

Author Comment

by:allio
ID: 2816307
thanks inthe, it worked :)
thanks also meikl
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Wininet read php file from internet issue 6 90
Best Firemonkey component pack 1 101
Delphi : could not find program, '...exe' 2 165
Create a path if not exists 7 76
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question