Using XamDataTree 12.1, I'm trying to select a tree node based on a value. Attached is my code. IsExpanded and IsActive works fine, however, IsSelected does not work.
Can you offer assistance or suggestions?
Hi,
Just looking over the code snippet you attached, I have a question about your comment that you had to rebind the ItemsSource. How and where are you binding the XamDataTree ItemSource? Are you indicating that the tree.ItemSource is null if you don't rebind?
One other question I have is, have you set the NodeSelection property for the XamDataTree? By default it would be Single but if you have set it to None, selection would not be possible.
It would be helpful if you could provide a small sample that includes your xamDataTree and its data source. If you could, please zip it up and attach it to this thread.
I hadn’t heard back from you and I was wondering if you have perhaps resolved your question.
Please let me know if I can be of assistance.
I was wondering if you had a chance to review my sample? Please let me know if you have any questions or if this answers your requirements.
I'm attaching a sample for you. There is code in the loaded event to verify that the DataContent and the xamDataTree ItemSource is already valued. I stilll have a question about why in your case you needed to set the ItemSource again.
In any case I suggest that you use the code to add the node to the SelectedNodes. You'll see inside the foreach block, I added the parent and the child nodes.
tree.SelectionSettings.SelectedNodes.Add(tn);
Please let me know if you have further questions.
I have not resolved this issue. Do you have a working sample or code snippet that works?
I need this ASAP. I have to close this project soon.
Thanks