-
Notifications
You must be signed in to change notification settings - Fork 66
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
UWP Treeview IsSelected and IsExpanded #48
Comments
Seems like you should start by debugging the TreeViewItem code to see what is null and then figure out why. If you're currently using NuGet I would try to grab the sources instead and include them in your solution. It makes debugging easier. |
Here are the inspection results from TreeItemView.cs in method
And I'm just setting the ItemsSource of the treeview to my data. |
Again, you should look at the source of the toolkit and at the details of the exception stack. The problem is more than likely in the toolkit code and you'd need to fix the toolkit to address your problem. |
Hi, |
You get a TreeViewItem for your node and set its IsExpanded value. You can
also use IsExpandedBindingPath if your nodes are generated in the view
model. I think there might be examples in the debugging tools project.
…On Wed, Mar 14, 2018 at 1:47 AM, Suren Saluka Manawatta < ***@***.***> wrote:
Hi,
Can someone guide me how programmatically expand and collapse the tree and
subtrees?
My app also a UWP and I currently do not use a property called IsExpand.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#48 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABrAsCUcfWTzkwNdy8GSZWaX6SJxk1xAks5teNkVgaJpZM4N7cqd>
.
|
I am attempting to override the style of the treeview and the treeview items. I have copied the styles from
https://github.com/xyzzer/WinRTXamlToolkit/blob/master/WinRTXamlToolkit/Controls/TreeView/TreeViewItem.xaml
and
https://github.com/xyzzer/WinRTXamlToolkit/blob/master/WinRTXamlToolkit/Controls/TreeView/TreeView.xaml
I added FontAwesome folder icons to control the expand collapse and removed the arrow toggle symbol. I added a couple of Setters for IsSelected and IsExpanded that are bound to two properties on my object that is part of the data source. However, when I run the application, I'm getting a null reference exception:
Here are the changes I made to the style. If I remove these the tree is rendered but I have no way of controlling expansion or selection:
This worked in WPF but I'm trying to create a UWP application from my existing source code and was not using the Toolkit prior to UWP. Please help!
The text was updated successfully, but these errors were encountered: