Hello, how do I set (scroll to) First Row In View ? ScrollToRow sets row last in view. Ty.
PS. Wrong subject, sorry.
Posted 15 November 2016 - 06:16 PM
Hello, how do I set (scroll to) First Row In View ? ScrollToRow sets row last in view. Ty.
PS. Wrong subject, sorry.
Posted 15 November 2016 - 06:53 PM
Hi,
In v6 you can use ScrollToCell(X, Y), or NextGrid61.ActiveView.ScrollToRow(Index).
In v5 you can use ScrollToRow(x).
In v5 you can scroll to first row in view with:
NextGrid1.ScrollToRow(NextGrid1.FirstRow);
Posted 15 November 2016 - 07:09 PM
Thanks for reply, perhaps I didn't make myself clear. I need to scroll to specified row so it will be on top of the visible part of grid, ScrollToRow makes specified row visible at bottom of grid. There is a function in FireMonkey Grid called TopRow, I need a NextGrid function doing the same. Using version 5 btw.
Posted 15 November 2016 - 07:17 PM
Posted 15 November 2016 - 07:23 PM
Thank you.
Posted 16 November 2016 - 03:48 PM
How can I avoid this infinite scroll when using VertScrollBar.Position ? I mean, when last row shown in bottom, I would like VertScrollBar.Position not to scroll more.
Posted 16 November 2016 - 06:14 PM
Hi,
Maybe this will help: You can decrease VertScrollBar.Position by VertScrollBar.PageSize (this is a number of rows in view).
Unfortunately never needed (and requested) SetTopRow before. Maybe this can be one of the next features.
Posted 17 November 2016 - 03:39 PM
Sorry to bother you with this very minor issue, but I don't understand how VertScrollBar.PageSize can help.
You can reproduce this behavior by doing the following:
- Add grid, button, then add let's say 20 rows
- Try to scroll like this:
button:
Posted 17 November 2016 - 06:54 PM
Hi,
Maybe something like this will help:
procedure TForm4.Button1Click(Sender: TObject); begin inc(ccc); if ccc <= Succ(nextgrid1.VertScrollBar.Max) - NextGrid1.VertScrollBar.PageSize then begin nextgrid1.VertScrollBar.Position := ccc; end; end;
Posted 18 November 2016 - 04:36 PM
Looks good, thank you!
0 members, 0 guests, 0 anonymous users