Thanks to visit codestin.com
Credit goes to github.com

Skip to content

DataGrid anchor selection does not use initial selection #10780

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Laniusexcubitor opened this issue Apr 16, 2025 · 0 comments
Open

DataGrid anchor selection does not use initial selection #10780

Laniusexcubitor opened this issue Apr 16, 2025 · 0 comments
Labels
Investigate Requires further investigation by the WPF team.

Comments

@Laniusexcubitor
Copy link

Description

When using a DataGrid with Extended SelectionMode which has an initial selection, an anchor selection does not work as expected.

Reproduction Steps

Repro project with DataGrid and ListBox
E.g. in the example project.

  • Item 1 is initially selected
  • Shift-Click on Item 3

Additional Scenario:

  • Now Select Item 1 via the ListBox
  • Shift Click on Item 5 in the DataGrid

Expected behavior

  • Item 1, Item 2 and Item 3 are selected after Shift-Click.

This expected behavior is the behavior that can be observed in the ListBox.
In the DataGrid this behavior occurs only when the initial selection was done by user input.

Additional Scenario

  • All items should be selected

Actual behavior

Only Item 3 is selected after the Shift-Click

Additional Scenario:
Only Items 3 to 5 are selected

Regression?

Tested in NetFx 4.81: same issue

Known Workarounds

No response

Impact

No response

Configuration

No response

Other information

_selectionAnchor is only updated on user input and the selection code does not check _selectionAnchor against the current true selection.
DataGrid.cs

@siagupta0202 siagupta0202 added the Investigate Requires further investigation by the WPF team. label Apr 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Investigate Requires further investigation by the WPF team.
Projects
None yet
Development

No branches or pull requests

2 participants