PDA

View Full Version : I need advanced help for DBCtrlGrid


N/A
09-19-2000, 06:22 AM
I would like to could show or hide controls of the panel of a DBCtrlGrid depending on the content of the registration.

Somebody could help me.

N/A
09-22-2000, 06:47 AM
OK, Since the controls would be children of the
DBControlGrid's DBCtrlPanel, you have to iterate
through them and toggle their Visible property.

procedure TForm1.Button1Click(Sender: TObject);
var
i: Integer;
myPermissions: Boolean;
myBkMark: TBookMark;
DBCPanel: TDBCtrlPanel;
begin
DBCtrlGrid1.DataSource.DataSet.DisableControls;
myBkMark := DBCtrlGrid1.DataSource.DataSet.GetBookmark;
myPermissions := False;
DBCPanel := TDBCtrlPanel(DBCtrlGrid1.Controls[0]);
for i := 0 to Pred(DBCPanel.ControlCount) do
DBCPanel.Controls[i].Visible := myPermissions;
DBCtrlGrid1.DataSource.DataSet.FreeBookmark(myBkMa rk);
DBCtrlGrid1.DataSource.DataSet.EnableControls;
end;