Solved

DBGrid Select

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

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…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

747 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now