Muhammad Idris Posted January 16, 2023 Share Posted January 16, 2023 how do you make the unidbgrid view match the panel or container layout ? Link to comment Share on other sites More sharing options...
irigsoft Posted January 16, 2023 Share Posted January 16, 2023 54 minutes ago, Muhammad Idris said: how do you make the unidbgrid view match the panel or container layout ? uniDBGrid.ForceFit := True; this will expand the Grid in width but also resize the columns, try it. Link to comment Share on other sites More sharing options...
Muhammad Idris Posted January 16, 2023 Author Share Posted January 16, 2023 it looks like this Link to comment Share on other sites More sharing options...
Sherzod Posted January 16, 2023 Share Posted January 16, 2023 20 minutes ago, Muhammad Idris said: What is your component nesting!? Do you have a simple testcase to check? Link to comment Share on other sites More sharing options...
irigsoft Posted January 16, 2023 Share Posted January 16, 2023 On 1/16/2023 at 12:53 PM, Muhammad Idris said: it looks like this procedure SetFormSize (SelForm : TUniForm); var ClientWidth, ClientHeight : Integer; begin Try SelForm.SuspendLayouts; SelForm.Left := 0; SelForm.Top := 0; ClientWidth := UniSession.UniApplication.ScreenWidth; ClientHeight := UniSession.UniApplication.ScreenHeight; SelForm.Width := ClientWidth; SelForm.Height := ClientHeight; if (uniMainModule.AppPlatform <> [upDesktop]) then begin SelForm.WindowState := wsNormal; SelForm.Left := 0; SelForm.Top := 0; //get screen size of device ClientWidth := UniSession.UniApplication.ScreenWidth; ClientHeight := UniSession.UniApplication.ScreenHeight; if UniSession.FormsList.Count <= 1 then exit; //get size of biger form if (ClientWidth < FormMinWidth) then ClientWidth := TUniForm (UniSession.FormsList [UniSession.FormsList.Count - 1]).Width; if (ClientHeight < FormMinHeight) then ClientHeight := TUniForm (UniSession.FormsList [UniSession.FormsList.Count - 1]).Height; //get default minsize if ClientWidth < FormMinWidth then ClientWidth := FormMinWidth; if ClientHeight < FormMinHeight then ClientHeight := FormMinHeight; //get Form's size if ClientWidth < SelForm.Width then ClientWidth := SelForm.Width; if ClientHeight < SelForm.Height then ClientHeight := SelForm.Height; //set Form's size SelForm.Width := ClientWidth; SelForm.Height := ClientHeight; end; SelForm.Repaint; //set mainform size form_general.Left := 0; form_general.Top := 0; form_general.Width := SelForm.Width; form_general.Height := SelForm.Height; form_general.Invalidate; //set Top form Size TUniForm (UniSession.FormsList [UniSession.FormsList.Count - 1]).Height := SelForm.Height; TUniForm (UniSession.FormsList [UniSession.FormsList.Count - 1]).Width := SelForm.Width; TUniForm (UniSession.FormsList [UniSession.FormsList.Count - 1]).Invalidate; Finally SelForm.ResumeLayouts; End; end; I'm using this function on the server side to expand the screen format. When I need to, I use DBgrid.Align := alClient and that works for me. There is a way to do this on the client side as well, but I can't be of help there! Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now