-
Notifications
You must be signed in to change notification settings - Fork 701
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
Question: SelectedItemChanged in TreeView #1334
Comments
I've never used TreeView as I'm waiting for it to stabilize some more. However, TreeViewItem derives from SelectorItem and even ListViewItem. This means it has an IsSelected dependency property. You could hookup a callback to this property and handle it manually. This is easiest if you are also manually adding items to the TreeView already. This should be feature request too. There are a lot of events standard in other repeater/selection controls that seem to be missing. |
No, I am not adding the items manually. I am using data binding. Given the TreeView does not even give the list of items, how can I hook a callback? |
You might want to take a look at the second reply from Nico Zhu here: If you create your own view model class with an IsSelected property you can bind it in the data template of the TreeViewItem. Then your model itself will be reporting this information and you could hook up an event to it (but you will have to add an event to to your view model classes). |
We recently noticed this oversight as well. @kaiguo did you have another bug tracking this or should we turn this into it? |
@jevansaks Yeah we have #322. Should we just close this one and use the other one to track? |
Yes, I'll mark this as dupe. |
how would I do this with SelectedItemsChanged? i'm trying to keep track of selected items. right now I'm doing it from a Tapped event on the treeview and have to loop through the entire treeview and figure out what is checked in my treeview and what is checked in my model that the nodes are bound to. if I bind to IsSelected it only works for single selection not multiple selection |
There is no SelectedItemChanged event in the TreeView, the WinForm one has this event. What is the alternative for it in UWP.
I need this event to give a summary of all the items selected by the user, plz suggest someway to achieve this.
The text was updated successfully, but these errors were encountered: