I'm not sure if this is the best place to ask .. but I'd love some guidance / samples on how to get Infragistics SL5 12.1 controls working with Visual Studio 2012 LightSwitch. I believe it is technically possible and I am particularly interested in getting the XamTree to work.
Can anyone help or point me in the right direction ? I can get as far as putting the XamTree on the "screen", but can't get any hierarchical data into the control.
Thanks
Gary
Hi Gary,
I'm in the process of trying this myself so I will let you know how it goes by Thursday.
Sorry for the late reply. I believe I'm fairly close to getting this to work in VS2012. At the moment I have the XamTree in the screen and I can bind some data to it. I'm running into an issue with binding hierarchical data to it so that's what I'm currently working to resolve. I will update you again early next week.
Please find attached to this post a sample demonstrating how you could use the XamTree in a VS2012 LightSwitch application and load it with hierarchical data. I created a seperate class library containing a UserControl with a XamTree setup. Once added to the screen, the UserControl's DataContext will be the screen which then lets the XamTree bind to the tables that were created in LightSwitch. There is a limitation however and it has to do more with LightSwitch then anything else. Enumerating over child records can't be done in the UI thread, an InvalidOperationException gets thrown. To get around this I use a converter that gets the child records and enumerates over them while inside a seperate thread. These values get stored in a temporary List which then afterwards gets moved to an ObservableCollection and is returned by the converter to the XamTree.
When you run the sample you will see a list on the left-hand side. Add a new Category and then add some Products from the center DataGrid. Once this is done click on the "Refresh Tree" button on the bottom right and the data will be updated inside the XamTree on the right.
Let me know if you have any questions on this.
Hi Rob
Thanks for your solution - I tested it and used it. I use VB, so I've converted your code to VB for my implementation.
I played with the XamTree heaps yesterday and got it working in my "real" application. I am using 4 levels of tree - they are fixed at 4, so I have defined each level with a specific HierarchicalDataTemplate. I also published some events in the user control to make the "Selected" event available in the LightSwitch application .. this all works beautifully. My plan was to publish all of this as I think it could be useful to others, but ran out of time. Let me know if you want me to document how I have implemented this.
Many thanks for your guidance.
I'm not sure if I'm just missing part of your last post but I don't see anything in the post itself. Have you taken a look at my sample? Did it help you at all?
Let me know if you have any questions on it.
Edit: I see the post now.
If you have the time then providing a document detailing what you did would indeed prove beneficial to the community. I'm also interested in seeing how you did this.
Let me know if you have any further questions on this matter.