Jump to content

DBGrid & ScrollIntoView


petr.nehez

Recommended Posts

  • 3 weeks later...
  • 5 months later...

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

Link to comment
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
Link to comment
Share on other sites

  • 5 years later...
  • 4 weeks later...
  • 2 weeks later...
  • 11 months later...
  • 2 weeks later...

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...