Jump to content

How do I click a button and jump to the next column?


eduardosuruagy

Recommended Posts

I want to click on a >> button and jump to the next column on the right and when I click on the << jump to the left column.
I was able to do using this form here:

type
     TMyUniDBGrid = class (TUniDBGrid)
   end;

   with TMyUniDBGrid (dbgrid_my) from
   begin
     CurrCol: = TMyUniDBGrid (dbgrid_my) .CrrCol + 1;
   end;

The problem is when you have a scrool on the grid, it does not follow the next column.
I wanted the scrool on the grid to be both to the right and to the left.

Link to comment
Share on other sites

Hi,

Can you try this approach?

procedure TMainForm.UniButton1Click(Sender: TObject);
begin
  with UniDBGrid1 do
  begin
    //try
      CurrCol := CurrCol + 1;
      JSInterface.JSCall('scrollTo', [Columns[CurrCol].JSColumn, True]);
    //except
    //end
  end;
end;

 

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