?
Solved

Multiselect in DBGRid

Posted on 1997-05-04
2
Medium Priority
?
400 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
[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 Comments
 
LVL 2

Accepted Solution

by:
javiertb earned 300 total points
ID: 1335894
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
ID: 1335895
Any help on evaluating questions?? ;-)
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

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…
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…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses
Course of the Month12 days, 2 hours left to enroll

752 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