Jump to content

uniFrame scrolls to UniDBGrid at onCreate


erich.wanker

Recommended Posts

Hi ..

 

i have a uniFrame .. on the Frame i have a lot of uniLabels and images and uniPanels and so on ..

 

on the Bottom  i have a small uniDBGrid ...

 

 

If i create the uniFrame - the frame is allways scrolled down to the uniDBGrid .. very annoying ;-)

 

 

How can i change this behavior?

 

ThanX for suggestions

 

Erich

Link to comment
Share on other sites

  • 1 month later...
  • 2 years later...

I'm having the same problem. To reproduce the scenario, follow the steps below. My unigui version: 1.0.0.1416.


1) Create an empty project.
2) Put a UniSimplePanel with Align = alClient
3) Create an Unigui Frame
4) Put some simplepanels into the frame as Align = alTop and a unidbgrid below.
5) The dbgrid must be binded with a datasource and dataset to reproduce the scenario
6) Increase the height so that it will be greater than your screen
7) On FormCreate of MainForm, use the code below to create the frame.

var Frame1: TUniFrame1;
Frame1 = TUniFrame1.Create(Self);
Frame1.Align := alClient;
Frame1.Parent := UniSimplePanel1;

7) Run your code and see that your frame will be positioned on the dbgrid.

Ps: It will only occurs when your dataset has result.

Link to comment
Share on other sites

I found a solution that is not so elegant.

1) set dbgrid with Visible = false.
2) On UniDBGrid AfterLoad put this code:
UniSession.AddJS('ajaxRequest(frameName.FramePanel,"UniDBGrid1",[])');
3) On UniFrame AjaxEvent put this code:

if (EventName = 'UniDBGrid1') then
    begin
        UniDBGrid1.Visible := true;
    end;

 

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...