Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

DBGrid Select

Posted on 2000-05-16
5
Medium Priority
?
314 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 400 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

610 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