Board index » delphi » TDBGrid & dgMultiSelect - HELP!!!

TDBGrid & dgMultiSelect - HELP!!!

Hi,

I'm developing a small application which, for various reasons, needs to
be in Delphi 2.  I normally use Delphi 3, but because of some components
which are needed and for which there is no D3 version available, I'm
forced to use D2.

anyway, I digress...

I've got a DBGrid from which I need to be able to select multiple
records.  This seems to work fine, but I'm unable to find any method of
establishing which of them is selected.  This is causing me a real
headache.  

The nature of the software would mean a complete rewrite of ten or
twenty meaty routines to do it using two databases or a list box.
Obviously, I want to avoid this.

Any assistance would be most appreciated.

Thanks in advance.
--
Paul Kirkpatrick

 

Re:TDBGrid & dgMultiSelect - HELP!!!


Quote
Paul Kirkpatrick wrote:
> I've got a DBGrid from which I need to be able to select multiple
> records.  This seems to work fine, but I'm unable to find any method of
> establishing which of them is selected.  This is causing me a real
> headache.

Have you thought of a really simple solution like adding a "selected"
field to your table, then using a checkbox in a TwwDBGrid?

Regards,

David Orme,
Coconut Palm Software, Inc.

Re:TDBGrid & dgMultiSelect - HELP!!!


Paul,

The D2 DBGrid has a property known as "SelectedRows", which is an array of
TBookmarks which  you can run thru to do things to SELECTED rows only!
{e.g., For I:=0 to SelectedRows.Count-1 do SelectedRows[I]:=...}

Hope this helps,

Re:TDBGrid & dgMultiSelect - HELP!!!


The DbGrid has a public property called "SelectedRows", which is basically
a list of bookmarks. The Borland web site has more info at

   http://www.borland.com/devsupport/delphi/ti_list/TI2976.html

John

Paul Kirkpatrick <p...@mhenwick.demon.co.uk> wrote in article
<saM$cBAne4tzE...@mhenwick.demon.co.uk>...

Quote
> Hi,

> I've got a DBGrid from which I need to be able to select multiple
> records.  This seems to work fine, but I'm unable to find any method of
> establishing which of them is selected.  This is causing me a real
> headache.  

Other Threads