Repository navigation
Conversation
Grouping or sorting by a column from code needed the internal ColumnGroupDescription and ColumnSortDescription, so an app couldn't start grouped by a column and still let the user ungroup it from the column's header. The header's commands now call these methods, so code and UI share one path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
4 of 12 tasks
This branch has not been deployed
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.
Description
Adds public
Sort,Group,UngroupandIsGroupedtoTableViewColumn: the code-side equivalent of the column header's Sort/Group/Ungroup commands.Today an app can group or sort from code only by adding a plain
GroupDescription/SortDescription. Those aren't tied to a column (ColumnGroupDescriptionandColumnSortDescriptionare internal), so the header shows no sort indicator for them and its Ungroup command doesn't apply. Starting a table grouped by a column, but still letting the user ungroup it from the header, isn't possible. I hit this in an app that groups devices by class by default.The logic moved from
TableViewColumnHeader(privateGroup,DoSort,ClearSortingWithEvent) to the column unchanged, and the header now calls the column. UI and code share one path. Behavior notes:Group()returnsfalsewhen grouping isn't allowed (CanGroup/CanGroupColumns), the column is already grouped, or aGroupinghandler setsHandled.Sort()returnsfalsewhen sorting isn't allowed or aSortinghandler handles it.Ungroup()doesn't requireCanGroup, so grouping can always be removed. The header still gates its command onCanGroupas before.Related Issue
None opened; happy to open one or move this to a discussion if you'd prefer.
Type of Change
Checklist
mainbranchGroup/Ungroup/IsGroupedare inside#if WINDOWSlike the rest of grouping)TableViewColumnSortingAndGroupingTests, 13 tests, passing locally)Additional Notes
Update: I got the WinUI test host running locally (building with
-p:Platform=x64and running the exe; the host fromdotnet test --arch x64exits at startup on my Windows Insider build). The 13 new tests pass, and the full suite passes exceptSelectingARowWithWideDetails_KeepsTheSelectionVisualsOnTheCells, which fails the same way on unmodifiedmainhere.🤖 Generated with Claude Code