Q: TDBCtrlGrid - as a readonly display

Delphi newbie warning.  Using Delphi 2.0

Hi all,

I am trying to use a TDBCtrlGrid to display a read-only (I wish to control
additions to the list through a button) list view of a DB.  I have set the
AllowInsert (and AllowDelete) property to False, and set the ReadOnly
property of all the components in the design panel of the TDBCtrlGrid to
True.  However, if you scroll to the bottom of the listbox, and then press
the down arrow icon on the scrollbar, it shows an empty entry (obviously to
allow appending).  As the controls are all ReadOnly, it is completely useless,
and I would like to stop this blank panel from appearing, am I missing
something obvious?  How can I achieve this?

While I have your time, in this same TDBCtrlGrib, I am hiding one of the
controls if it is unnecessary, I have the following code in the OnPaintPanel
  with dmX do
    DBEdit2.Visible := tblXRangeStart.Value <> tblXRangeEnd.Value;
    Label2.Visible := DBEdit2.Visible;

I have sample data in which one record of three matches the criteria in the
test.  When the grid is first drawn, the label in the matching panel
(ie: the one that should be invisible) shows strange colours!  Once I click
inside the Grid, all seems ok, except if I scroll off the top of the list,
the Edit component flashes into and out of visibility (not a major problem).

Even more interesting, if I remove the assignment to the Label component,
the Edit component which should be invisible is visible when the form is first
shown, and whenever the panel in the Grid in which the Edit should be
has focus!  This behaviour is corrected by adding the Label assignment code!

Any suggestions or explanations?

Sean A Reith                                  sre...@aesprodata.com.au

The opinions expressed in this message are those of the author and not
necessarily those of ERG Limited or its associated companies.