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

Is there a way to asynchronously populate row children before (or during) expanding? #142

Open
TETYYS opened this issue Nov 13, 2022 · 1 comment

Comments

@TETYYS
Copy link

TETYYS commented Nov 13, 2022

I am looking at files page sample (https://github.com/AvaloniaUI/Avalonia.Controls.TreeDataGrid/blob/master/samples/TreeDataGridDemo/ViewModels/FilesPageViewModel.cs) which loads row children on access (https://github.com/AvaloniaUI/Avalonia.Controls.TreeDataGrid/blob/master/samples/TreeDataGridDemo/Models/FileTreeNodeModel.cs#L80), however all of it is synchronous I/O access.

Is there a way maybe pre-load data so that .Children access would get it from cache? By the looks of it, as soon as you expand a row, everything in chain expects data to be ready immediately, so there is no point in time one could load data asynchronously.

@slavslavin
Copy link

Hello,
We use Behavior<TreeDataGrid> and subscribe on HierarchicalTreeDataGridSource<object>.RowExpanding event by using reflection. In event handler we start async children loading (vm layer) and after complete expand node in tree view.

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

No branches or pull requests

2 participants