Skip to content

ListView ScrollIntoView() calls fail in a grouped list under certain circumstances #4797

Open
@DHancock

Description

@DHancock
  • .NET Core Version: 5.0.301
  • Windows version: 20H2 (OS build 19042.1052)
  • Does the bug reproduce also in WPF for .NET Framework 4.8?: Yes
  • Is this bug related specifically to tooling in Visual Studio (e.g. XAML Designer, Code editing, etc...)? No

Problem description:

My program has a list view containing a couple of hundred items spread across several groups. To aid the user find an item there is a search feature. It reads the user input, finds the associated list item, expands the group that the item belongs to (via a bound property), selects the item and then calls ScrollIntoView(). If the group that the item belongs to hasn't previously been expanded then ScrollIntoView() fails to scroll correctly.

Actual behavior:

Item isn't scrolled in to view unless the group that the item belongs to has previously been expanded.

Expected behavior:

It is.

Minimal repro:

FreeLunch.zip

Notes

It looks like expanding the group isn't a synchronous process and when the ItemContainerGenerator status is tested in ScrollIntoView() it doesn't show that the new item containers haven't been generated yet.

The program worked correctly when built with Net Framework 4.5.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    .NET FrameworkAccessibilityAn issue related to accessibility enhancements or blockers.BugProduct bug (most likely)

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions