?
Solved

Get "Selection set" from DBGrid?

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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

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…
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…
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…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

649 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