🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.database.ado
Article #3046

How to select by code all records in a DBGrid?

#3046
From: Alen Markov
Date: Fri, 03 Jan 2003 19:44
46 lines
2185 bytes
I'm still "fighting" with that DBGrid:

I need to copy the content of one column of the DBGrid to a combobx

1.)
Let's say I have a DGBrid with a few rows displayed.
I can select a few rows by mouse and then I know how to copy the
SELECTED rows (of a particular column) to the combobox.
(an example can be easily found in the Builders helpfile...)

But thist must happen at programstart (Event OnShow from the form),
means I need somehow to select all the rows in the DBGrid automatically.

How to select all records in a DBGrid by programmcode?


2.)
Another approach how to fill the combobox with rows displayed in a column
of a DBGrid would be, If I would know how to access for example
in column number 0 the row number 3...

I've found out that I can access column number 0, row number 0
for example like this:

void __fastcall TForm1::Button2Click(TObject *Sender)
{
   Label1->Caption = DBGrid1->Columns->Items[0]->Field->AsString;
}

But how to access rows number 1, 2, 3 and so on...?




Any hint would be greatly appreciated...


Thanks  a lot in advance and best regards

Alen




--
WEB: http://www.come.to/nostromo
Technical Details
Message-ID: <3e15e83a$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-01!sn-xit-09!supernews.com!64.152.100.70.MISMATCH!sjc70.webusenet.com!news.webusenet.com!gestalt.direcpc.com!telocity-west!DIRECTV!203.109.225.2!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10698b,13f65491e8885df5,start
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2003-01-03 12:02:09 PST
From: "Alen Markov" <NOSPAM_amarkov@gmx.net>
Newsgroups: borland.public.cppbuilder.database.ado
Subject: How to select by code all records in a DBGrid?
Date: Fri, 3 Jan 2003 20:44:39 +0100
Lines: 48
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
NNTP-Posting-Host: 80.218.79.120
Message-ID: <3e15e83a$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1041623098 80.218.79.120 (3 Jan 2003 11:44:58 -0800)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-01!sn-xit-09!supernews.com!64.152.100.70.MISMATCH!sjc70.webusenet.com!news.webusenet.com!gestalt.direcpc.com!telocity-west!DIRECTV!203.109.225.2!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail