Amélie Posted August 31, 2023 Share Posted August 31, 2023 Hi, In my project, I have a UniDBGid with the "RowWidget" property enabled = true. When I click on the '+' of this DBGrid, a TUniFrame is displayed. I want to modify the height of this Frame by code, how to do it please? Thanks in advance Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 31, 2023 Share Posted August 31, 2023 Hello, Can you please specify first, which edition and build of uniGUI are you using? Quote Link to comment Share on other sites More sharing options...
Amélie Posted August 31, 2023 Author Share Posted August 31, 2023 Hi Sherzod, Yes, the trial version, thank you Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 31, 2023 Share Posted August 31, 2023 13 minutes ago, Amélie said: Yes, the trial version, thank you Are you still using trial version?  4 hours ago, Amélie said: I want to modify the height of this Frame by code, how to do it please? This post may help you, can you try?  Quote Link to comment Share on other sites More sharing options...
Amélie Posted August 31, 2023 Author Share Posted August 31, 2023 Thanks, I have already read this article, but it is not what I want (change the height of TUniFrame). Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 31, 2023 Share Posted August 31, 2023 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;  Quote Link to comment Share on other sites More sharing options...
Amélie Posted August 31, 2023 Author Share Posted August 31, 2023 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  Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 31, 2023 Share Posted August 31, 2023 9 minutes ago, Amélie said: 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)? I think now the link above will definitely help you. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 31, 2023 Share Posted August 31, 2023 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; Â Quote Link to comment Share on other sites More sharing options...
Amélie Posted August 31, 2023 Author Share Posted August 31, 2023 Perfect ! Thank you Sherzod 😊 I used TFrame1 instead of RowControl and i still got an error. Thank you again  Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.