?
Solved

Get "Selection set" from DBGrid?

Posted on 1997-10-07
4
Medium Priority
?
168 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 200 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

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

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

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…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses
Course of the Month11 days, 10 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