Complete multi-row drag selection behavior#316
Open
wieslawsoltes wants to merge 1 commit into
Open
Conversation
Owner
Author
|
Self-review completed. I reviewed deferred selection lifecycle, pointer cancellation, drag-start gating, multi-selection behavior, and regression coverage; no additional actionable findings were found. All six CI checks are successful, the branch is synchronized, and git diff --check is clean. This PR is ready for review. |
wieslawsoltes
marked this pull request as ready for review
July 15, 2026 00:23
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Completes the multi-row drag gesture so selected rows remain intact while drag intent is being determined, while preserving normal click selection behavior when no drag occurs.
Problem analysis
The repository already had the two core pieces needed for multi-row drag:
DataGridRowDragDropController.TryCreateDragInfo()uses all selected rows when the pressed row is selected andDragSelectedRowsis enabled.SuppressSelectionDragFromDragHandleis enabled.The remaining gap was pointer-release behavior. Preserving selection unconditionally on press solved drag startup, but it also meant a simple click on one selected row never performed the usual selection collapse. The issue discussion correctly identifies the required sequencing: preserve on press, decide between click and drag, then apply click selection on release only if the drag threshold was not crossed.
Implementation
DataGridnow owns a small deferred row-selection record containing the pointer id, row slot, column surface, and original press event.SelectedItemsbehavior consistentThe controller and selection code share one
CanStartRowDragGesture()predicate so gesture suppression cannot diverge from actual drag eligibility.No view code-behind, reflection, static state, or new public API is introduced.
Tests
Headless coverage verifies:
Validation performed:
net8.0: 0 errorsnet10.0: 0 errorsFixes #296