You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Assume we have a collection with 50 items numbered 1..50. The Table can show 10 items at a time.
Now when we table.ScrollIntoView(<item19>), the item19 shows as the last row in the table.
OK.
But when we have the view start with item35 in the first row and then table.ScrollIntoView(<item19>), the first row shows item20, not item19. That is, scrolling backwards is always one row off.
I checked with the plain ListView so to exclude a (flaw) Winui 3 behavior. Works fine.
The text was updated successfully, but these errors were encountered:
this is because of the header row, the ScrollIntoView(object item) doesn't take care of this behavior. The method itself is not overridable. I use a ScrollRowIntoView(int index) method to overcome this issue but the method is private. I can make it visible if that works for you!
please let me know if there are any other possibilities to do that.
If the intention is to align the method signature with the base class, it should be ScrollRowIntoView(object item) rather than ShowRowIntoView(object item). However, using an object to scroll a row into view would have drawbacks when there are duplicate items in ItemsSource. See the enhancement I proposed here microsoft/microsoft-ui-xaml#9890.
OK with me.
I checked my recent projects and I found that I nearly all the times scroll to the SelectedItem.
So using the index instead of the object would require an additional lookup.
Assume we have a collection with 50 items numbered 1..50. The Table can show 10 items at a time.
Now when we
table.ScrollIntoView(<item19>)
, the item19 shows as the last row in the table.OK.
But when we have the view start with item35 in the first row and then
table.ScrollIntoView(<item19>)
, the first row shows item20, not item19. That is, scrolling backwards is always one row off.I checked with the plain ListView so to exclude a (flaw) Winui 3 behavior. Works fine.
The text was updated successfully, but these errors were encountered: