Solved

Get "Selection set" from DBGrid?

Posted on 1997-10-07
4
166 Views
Last Modified: 2010-05-18
Is it possible to get a selection set from a DBGrid.
By setting dgMultiSelect to True, it is possible to select more than one record. I want to be able to get for example: Field number 3 in the second selected record, or the whole fifth selected record for example.

I run Delphi Developer 2.0 and the table is a DBase-table...

Thanx!
Erik N.
0
Comment
Question by:Erik N
[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
4 Comments
 
LVL 5

Accepted Solution

by:
ronit051397 earned 50 total points
ID: 1346929
1. See explanation in the file manuals.txt.
2. example:

var I, J: Integer;

  with DBGrid.SelectedRows, Table1 do //the records from the grid
                                        belong to Table1
  for I:=0 to Count-1 do //do some actions only on the selected                            records
  begin
    Find(Items[I],J);
    Bookmark:=items[I];
    Edit;
    //do something with the current selected record
    Post;
  end;
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1346930
In the multi selected records case, Borland recommands to use the
Find method and not the GotoBookmark method (I Don't know why),
See the manuals.txt file.

0
 
LVL 5

Expert Comment

by:ronit051397
ID: 1346931
Ronit,

10x for the advise!

ZifNab.
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1346932
Thank you Ronit, for your good answer.
I also thanks ZifNab for his comment, it helped a lot!

0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

749 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