Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to scroll to a certain item?

Is there a way to scroll to a certain item or at least to a selected one? I'm using TreeListView, but it looks like simple ObjectListView can't scroll by demand as well..

like image 471
tas Avatar asked Dec 11 '25 13:12

tas


2 Answers

Try

myOlv.EnsureModelVisible(myModelObject)

I haven't tested it, but if i remember correctly it is supposed to scroll the view to make the given item/model visible.

like image 94
Rev Avatar answered Dec 13 '25 17:12

Rev


If you want to have the item at the top of the list I do something like this and it seems to work:

fastObjectListView.EnsureVisible(fastObjectListView.GetItemCount()-1);
fastObjectListView.EnsureVisible(indexToMakeVisible);
like image 40
Christopher Townsend Avatar answered Dec 13 '25 18:12

Christopher Townsend



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!