Jump to content

Recommended Posts

Posted

Hi All

how before open dataset dbgrid scroll left?

I try this but not work

dataset.close

gridmain.ScrollBy(-100, 0);  left

dataset.open;

 

Posted

Hi Ulugbek.

 

Try this:

uses ... UniGUIApplication ...
UniDBGrid1.JSName+'.scrollByDeltaX(-gridScrollXValue);'
UniSession.AddJS('var gridScrollXValue='+UniDBGrid1.JSName+'.getView().el.dom.scrollLeft;'+UniDBGrid1.JSName+'.scrollByDeltaX(-gridScrollXValue);'+UniDBGrid1.JSName+'.scrollByDeltaX(gridScrollXValue);');
DataSet.Close;
DataSet.Open;

 

 

Sincerely

Posted
Hi Ulugbek.
 
 
Gone was an error while rendering?
 
Just this code returns the position of scroll in its place:
 
UniSession.AddJS('var gridScrollXValue='+UniDBGrid1.JSName+'.getView().el.dom.scrollLeft;'+UniDBGrid1.JSName+'.scrollByDeltaX(-gridScrollXValue);'+UniDBGrid1.JSName+'.scrollByDeltaX(gridScrollXValue);');
DataSet.Close;
DataSet.Open;

 

 
And this code returns to the starting left position:
 
UniSession.AddJS('var gridScrollXValue='+UniDBGrid1.JSName+'.getView().el.dom.scrollLeft;'+UniDBGrid1.JSName+'.scrollByDeltaX(-gridScrollXValue);');
DataSet.Close;
DataSet.Open;

 

 
The problem is that if you select the last column, then the code is not executed correctly, ie in the sense of running, but again, the highlight remains the selected column.
 
 
Gone was an error while rendering?
 
 
 
Sincerely.
Posted
Hi Ulugbek.

 

I know there are other solutions, but for now can use the following code:

 



type THackGrid = class(TUniDBGrid);



THackGrid(UniDBGrid1).CurrCol := 0;
DataSource1.DataSet.Close;
DataSource1.DataSet.Open;



 

Sincerely ...

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