Solved

DBGrid Select

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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

Suggested Solutions

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…
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…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

837 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