I am trying to work out how to get and set a SelectedItem/ActiveNode property with a twoway binding on the xamDataTree.
Using behaviors I can get the item that is selected by the user but am struggling to set it programmatically.
The example I based my code on is from this blog post. http://blogs.infragistics.com/blogs/devin_rader/archive/2011/06/01/using-behaviors-to-synchronize-selected-items-of-infragistics-silverlight-controls-to-a-viewmodel.aspx
Any help is welcome.
Hello,
I have created a sample application that allow you to bind the selected item of the XamDataTree. The application demonstrates how you can inherit the XamDataTree class and add a custom Dependency Property called SelectedItem. Then you can use the this class in your window instead the XamDataTree and bind the SelectedItem property to a property of your ViewModel.
If you need any further assistance please do not hesitate to ask.
Sincerely,
Krasimir
Developer Support Engineer
Infragistics
www.infragistics.com/support
Hello Krasimir,Your example is fantastic. Can you tell me how dependent the ViewModel can place an icon in the data tree.Thanks in advance
Johan
Hello Johan,
Thank you for your reply. I am very glad that my sample application was helpful for you. I have been looking into your question and I can suggest referring to the following forum thread, which show an approach for showing icons in the tree nodes, based on the view model: http://es.infragistics.com/community/forums/t/79923.aspx.
Please let me know if you need any further assistance on the matter.