Solved

DBGrid Select

Posted on 2000-05-16
5
312 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 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

691 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