Skip to content
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

Make switching between flat and tree layouts easier. #277

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

grokys
Copy link
Member

@grokys grokys commented Mar 22, 2024

  • Add setters for Items and Selection on ITreeDataGridSource: this allows one to more easily operate on both flat and tree sources using the same interface
  • Fix an issue where columns were not being correctly resized when switching between sources
  • Add a simple example to "Files" view of switching between tree and flat views (flat view isn't really particularly functional currently, it's just intended as a simple example for the moment)

Note that this PR does not add a RowSelection or CellSelection property to ITreeDataGridSource, as it's envisioned that future sources will not want to expose these. Given that those properties are just casting Selection to the relevant type, it's easy enough to do this using e.g. an extension method anyway if desired.

To allow easier switching between types of source.
AvaloniaUI/Avalonia#15075 breaks a test I'm currently writing.
Columns are initialized sized incorrectly.
Don't call `UpdateColumnSizes` when the viewport changes if no measure pass has been carried out yet.
@danipen
Copy link
Collaborator

danipen commented Apr 1, 2024

@grokys we don't need this PR anymore.

But probably you still want to merge it since this API helps anyone trying to use both flat/hierarchical rows in the future. What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants