dotnet / dotnet/wpf

Full ItemSource iteration on ExtendSelection

Open
#8,531 1 comment 0 reactions 0 assignees View on GitHub
Enhancement Requested
Dominant language
C#
Stars
7.7k
Forks
1.3k
Avg merge
1d 11h
Merged PRs (30d)
61

Description

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?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.