This is probably just me not knowing how to make this control do this but...
I have a list of items and in-code I'm selecting an item that off-screen but RadListView doesn't auto-scroll to that item. it IS selected just not in view.
Do I have to do something like: radListView1.ShowSelectedItem(someRadListDataItem)
or perhaps from the item itself? Something that works like this: someRadListDataItem.EnsureVisible = True
Any help would be appreciated.
5 Answers, 1 is accepted
You can use the following methods:
Hello R A,
It depends on the scenario and when you want to call the ScrollIntoView() method. Basically, you can use Custom Attached Property and execute your logic in the property change method. Give this approach a try and let me know if it works for you.
I see a property called "IsScrollIntoViewEnabled". Is this something related?
Hi R A,
You are right. I have overlooked the first question in this thread, and I apologize for that. Yes, this property is related to the selected item. If an item is selected, it will automatically be scrolled into the view. This property is true by default. You could bind the SelectedItem property of the RadListBox to a custom property in your ViewModel. Then when you set the custom property to an item from the bound collection, which is outside the view, the control will bring it into the view automatically. The attached project demonstrates this behavior.
If you want to bring a specific item that is not selected into the view, you should use the ScrollIntoView() method.
Our thoughts here at Progress are with those affected by the outbreak.