View Full Version : I need advanced help for DBCtrlGrid
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.
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;
vBulletin® v3.8.7, Copyright ©2000-2013, vBulletin Solutions, Inc.