Jump to content

Using multiple TuniStringGrid's and would like to sync horizontal Schroll


rhennink

Recommended Posts

Hi,

We have multiple TuniStringGrid's on one form with (for example) 40 columns.

If we scroll (horizontally) in one of the grids, we would like that the other grid's are scrolling at exact the same position (horizontally).

How can we do that??

 

RIchard

 

Link to comment
Share on other sites

  • 1 year later...

HI ,

The situation is that I have one view with 2 grids. Both grids have 31 days columns, with the days of the month in it.

I used the UniScrollbox to scroll both grids simultaneously which worked perfectly, but 😉

Both grids have 2 fixedCols, which are als moving away when we move to the right with the UniScrollbox. (and this is off course normal behaviour)

And we would like that fixed cols are always visible if we are moving the grids to the right.

 

Any workaround how we can fix this?

I Tried with the function below, but this doesn't work (in the current /latest) version.

UniStringGrid1.JSInterface.JSAddListener('activate', 'function() {'+UniStringGrid1.JSName +'.getScrollable().scrollTo({x: #})}');" b
Link to comment
Share on other sites

  • 2 weeks later...

try   UniStringgrid1->clientevent->afterrender

function afterrender(sender, eOpts)
{
   sender.view.el.addListener('scroll',function(e,t){
     MainForm.UniStringGrid2.view.el.dom.scrollTop=t.scrollTop;
     MainForm.UniStringGrid2.view.el.dom.scrollLeft=t.scrollLeft;     
   });
}

Link to comment
Share on other sites

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