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

TreeView can't auto scroll to the selected item #9200

Closed
wuyang26 opened this issue Jan 3, 2024 · 5 comments
Closed

TreeView can't auto scroll to the selected item #9200

wuyang26 opened this issue Jan 3, 2024 · 5 comments
Labels
area-TreeView bug Something isn't working needs-triage Issue needs to be triaged by the area owners team-Controls Issue for the Controls team

Comments

@wuyang26
Copy link

wuyang26 commented Jan 3, 2024

Describe the bug

By ItemSource binding data ,If the Selected Item has not been displayed yet, you cannot scroll to this selection

the code:
 var treeList = TreeHelper.FindVisualChild<TreeViewList>(treeView);
 treeList.ScrollIntoView(treeView.SelectedNode);

Steps to reproduce the bug

1、binding the treeview ItemSource property
2、Write a button click event
3、Expand tree items in the event (select an item outside of the visible view to expand by code)
4、Execute sub item selection under expanded items by code
5、Execute scrolling to selection items in the event
var treeList = TreeHelper.FindVisualChild(treeView);
treeList.ScrollIntoView(treeView.SelectedNode);

Expected behavior

No response

Screenshots

No response

NuGet package version

WinUI 3 - Windows App SDK 1.4.3: 1.4.231115000

Windows version

Windows 11 (22H2): Build 22621

Additional context

No response

@wuyang26 wuyang26 added the bug Something isn't working label Jan 3, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the needs-triage Issue needs to be triaged by the area owners label Jan 3, 2024
Copy link

github-actions bot commented Jan 3, 2024

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one. Thank you!

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@wuyang26
Copy link
Author

wuyang26 commented Jan 3, 2024

Not within the above issues!

@bpulliam bpulliam added area-TreeView team-Controls Issue for the Controls team and removed needs-triage Issue needs to be triaged by the area owners labels Jan 5, 2024
@ranjeshj
Copy link
Contributor

ranjeshj commented Feb 6, 2024

Is the selected node collapsed? Would expanding the parent node first make this realized and then you can scroll into view ?

@weitzhandler
Copy link
Contributor

This issue still exists.

@microsoft-github-policy-service microsoft-github-policy-service bot added needs-triage Issue needs to be triaged by the area owners and removed no-recent-activity labels Mar 14, 2024
@wuyang26
Copy link
Author

No, can not scroll into view. I think because ui virtualizationv.
Before the first expand,the visual tree has not yet been implemented,like wpf treeview,but wpf can realize by additional behavior,yet can not find the same event Selected in winui TreeViewItem.

@microsoft-github-policy-service microsoft-github-policy-service bot removed the needs-author-feedback Asked author to supply more information. label Mar 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-TreeView bug Something isn't working needs-triage Issue needs to be triaged by the area owners team-Controls Issue for the Controls team
Projects
None yet
Development

No branches or pull requests

4 participants