Board index » delphi » Controls on TDBCtrlGrid

Controls on TDBCtrlGrid

Hi,

maybe a stupid question, but how can I access the controls I habe placed
on a TDBCtrlGrid? I want the enable/disable some of the controls I
placed on the grid, depending on the content of the displayed record. I
tried TDBCtrlGrid.Controls, but it seems not to be what I'm looking for.

Tnx 1.0e6
Carsten

 

Re:Controls on TDBCtrlGrid


Hello Carsten,

Here is a sample:

procedure TForm1.Button1Click(Sender: TObject);
var
  I, J: Integer;
  MyPanel: TDBCtrlPanel;
begin
  for I := 0 to DBCtrlGrid1.ControlCount - 1 do
    if DBCtrlGrid1.Controls[I] is TDBCtrlPanel then begin
      MyPanel := TDBCtrlPanel(DBCtrlGrid1.Controls[I]);
      for J := 0 to MyPanel.ControlCount - 1 do
        MyPanel.Controls[J].Enabled := False;
      Break;
    end;
end;

--
Kind regards, Andrei Fomine, Quasidata.
DbAltGrid allows multi-line layout and RTF text in a DBGrid descendant.
http://www.dbaltgrid.com/

Quote
"Carsten Grnzner" <cgruenz...@compuserve.com> wrote in message

news:39f584f9_1@dnews...
Hi,

maybe a stupid question, but how can I access the controls I habe placed
on a TDBCtrlGrid? I want the enable/disable some of the controls I
placed on the grid, depending on the content of the displayed record. I
tried TDBCtrlGrid.Controls, but it seems not to be what I'm looking for.

Tnx 1.0e6
Carsten

Other Threads