Solved

Get "Selection set" from DBGrid?

Posted on 1997-10-07
4
165 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
  • 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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

Title # Comments Views Activity
delphi exception 7 68
Printing problem 2 102
oracle global variables 4 76
Delphi: sending SMS on android platform 1 35
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…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

829 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