Solved

Multiselect in DBGRid

Posted on 1997-05-04
2
377 Views
Last Modified: 2010-04-06
Hello,

I'm using Delphi 2.0 with the new DBGrid component where you have
the option to set multiselect on.
How do I know how many and wich records are selected in such a DBGrid ?  

Thanks in advance,
Pascal Corstjens
Belgium

Corpa@glo.be
0
Comment
Question by:corpa
  • 2
2 Comments
 
LVL 2

Accepted Solution

by:
javiertb earned 100 total points
Comment Utility
Just try this:

     NumSelected:=0;
     
     Table.Open;
     Table.First;
     while (not Table.EOF) do
     begin
        if DBGrid.SelectedRows.CurrentRowSelected then
        begin
          // Do whatever you want
          // with the selected record  
          NumSelected:=NumSelected+1; //Number of selected rows
        end;
        Table.Next;
      end

You can also use bookmarks to avoid losing previous database pointer.
0
 
LVL 2

Expert Comment

by:javiertb
Comment Utility
Any help on evaluating questions?? ;-)
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
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…

762 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

12 Experts available now in Live!

Get 1:1 Help Now