Jump to content

TUniFrame : change the height of the TUniFrame at runtime


Amélie

Recommended Posts

29 minutes ago, Amélie said:

Thanks, I have already read this article, but it is not what I want (change the height of TUniFrame).

Okay.

You can use OnRowExpand event for this I think:

procedure TMainForm.UniDBGrid1RowExpand(Sender: TUniCustomDBGrid;
  const RowId: Integer; var RowControl: TControl; Container: TUniContainer);
begin
  RowControl := TDetailFrame.Create(Container);
  
  //Some conditions
  RowControl.Height := xx
end;

 

Link to comment
Share on other sites

Thanks Sherzode, it works. in my Frame, there is a UniDBGrid, is it possible to set the height of the Frame to the height of the UniDBGrid (which in the Frame)?
ie access the height of the Frame to modify it according to the height of the UniDBGrid
 
 RowControl.Height   := MyFrame1.DBGrid1.Height;

I get an error with this code

 
Link to comment
Share on other sites

procedure TMainForm.UniDBGrid1RowExpand(Sender: TUniCustomDBGrid;
  const RowId: Integer; var RowControl: TControl; Container: TUniContainer);
begin
  RowControl := TDetailFrame.Create(Container);

  if (RowControl.FindComponent('UniDBGrid1')) <> Nil then
    RowControl.Height := TUniDBGrid(RowControl.FindComponent('UniDBGrid1')).Height

end;

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...