Skip to content

Full ItemSource iteration on ExtendSelection #8531

@lolomarka

Description

@lolomarka

https://github.com/dotnet/wpf/blame/4ae9e616402ba1128eb11fb075746ed9b2fd6269/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Controls/DataGrid.cs#L4845

FullRow Extending Selection traverses all ItemSources from index 0 to endIndex, stacking the UI if the ItemSource contains a large number of items.

For example, there are more than 1,000,000 rows and the selection starts somewhere at the end of the datagrid. Colossal load on the ItemsSource. In my case, ItemsSource is a virtualised collection, so if an item was not in the collection, a request is sent to the database to load it.

So I end up having to find a workaround, set DataGrid.SelectionMode == Single, and simulate Extended mode in my code.

Please, say, for what enumerator is here, and may it be fixed?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Enhancement RequestedProduct code improvement that does NOT require public API changes/additions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions