Board index » delphi » QUESTION: DBCtrlGrid's component's parent property

QUESTION: DBCtrlGrid's component's parent property

What is happening to the Parent property of a component dropped on a
DBCtrlGrid?

I'm using D3.01 (build 5.83) and I would like to be able to determine if
a
control's parent is the DBCtrlGrid.  Specifically, I would like to use
the
Parent.Name property.  For some reason it seems to get whacked.

Here is a simple little project that will show my problem.

1) Select File->New Application

2) Drop a DBCtrlGrid, Table, and DataSource component on your form.

3) Line the DataSource to the Table and link the Table to any existing
table.

4) Set the DBCtrlGrid DataSource property to the DataSource.

5) Drop a DBEdit component on the DBCtrlGrid and set it's DataField
property
to any field in the table.

6) Set the DBEdit OnClick event to this:

procedure TForm1.DBEdit1Click(Sender: TObject);
begin
  ShowMessage( DBEdit1.Parent.Name );
end;

7) Run the program and click on the DBEdit.  The ShowMessage text is an
empty string!  Shouldn't it say 'DBCtrlGrid1'?

Is this a bug or am I missing something?

Thanks,
Neal
n...@mi-assistant.com

 

Re:QUESTION: DBCtrlGrid's component's parent property


Daniel,

I came across the same issue with DBCtrlGrid and to my surprise I didn't
get a response either.  Maybe we've found one that's finally too hard for
our Delphi guru friends?  If anyone does have the answer I'm sure we would
both be very interested to hear from you?

Alex

Quote
> What is happening to the Parent property of a component dropped on a
> DBCtrlGrid?

Other Threads