Jump to content
uniGUI Discussion Forums
petr.nehez

DBGrid & ScrollIntoView

Recommended Posts

I would like to scroll the grid when a new record is created and this record is active.

Is there a way how to do it?

 

If I locate the record and refresh the grid, the selection is on the right record but the scrollbar is on the top...

Share this post


Link to post
Share on other sites

We may have an example implementation?, I have the same problem when I use the commands ADO.next, ADO.last, ADO.prior, etc.

Share this post


Link to post
Share on other sites

Anyone found a solution to force the grid to show the selected record?

 

Using version 0.91.0.984.

 

I tried:

 

MyFrame.myGrid.getView().focusRow(number);

MyFrame.myGrid.getView().getSelectionModel().select(number);

MyFrame.myGrid.getView().highlightItem(number);

scrollToView() too.

 

Nothing works.

 

Thx!

 

Bruno

Share this post


Link to post
Share on other sites

Maybe it will help:

 

if unidbgrid.WebOptions.Paged then
UniSession.AddJS('setTimeout(function () {'+
        'MainForm.unidbgrid.getView().focusRow('+IntToStr((unidbgrid.datasource.dataset.RecNo mod unidbgrid.WebOptions.PageSize)-1)+');'+
    '}, 100);'
)
else
UniSession.AddJS('setTimeout(function () {'+
        'MainForm.unidbgrid.getView().focusRow('+IntToStr(unidbgrid.datasource.dataset.RecNo-1)+');'+
    '}, 100);'
);

 

It works for me))

  • Upvote 1

Share this post


Link to post
Share on other sites

Hi.

 

I'm trying this solution using the version FMSoft_uniGUI_Complete_Professional_1.10.0.1464.

 

But don't work.

 

Help?

Share this post


Link to post
Share on other sites

Hi,

 

Can you please explain in more details, what problem do you have ?!

Share this post


Link to post
Share on other sites

Hi.

 

I'm using unidbgrid with many records.

 

When locating the record does not scroll until the record in uniDBGrid.

Share this post


Link to post
Share on other sites

Hi,

 

When locating the record does not scroll until the record in uniDBGrid.

 

I couldn't reproduce.

 

How can we reproduce this, can you make a simple testcase for this ?!

Share this post


Link to post
Share on other sites

Hi.

 

Sorry I'm late.

 

I could simulate the problem.

 

The bug has to do with the amount of records.

 

Follow test.

Test.zip

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×