Hi,
I have an issue with the data binding and "Active item" property. When I select a row in the grid, the Active item works correctly: the property attached to the Active Item is correctly populated.I navigate to another page and go back to the page with the grid. On the view, no row are selected (ActiveItem is null) while the property attached in my viewmodel have always the row value.
Why the row isn't selected in the grid after the navigation?
Hello MichelinDPPI2,
Thank you for your post.
I have been investigating into this under the impression that you are using the Silverlight page navigation as explained here: https://msdn.microsoft.com/en-us/library/cc838245(v=vs.95).aspx. Please let me know if I am wrong, as the following goes off of that impression.
By default, when a page is navigated to in Silverlight, a new instance of that page will be created, and everything in that page will be recreated as well. I believe this is very likely why you aren't seeing the XamGrid's active item set correctly when you navigate back to your page after navigating away from it - because the grid is being recreated as a new instance of your grid. To get around this, I would recommend setting the NavigationCacheMode property on the Page that contains your XamGrid to "Enabled" or "Required." This will keep the page in memory, and will not recreate all of the elements in it when the page is navigated to after navigating away from it.
I have attached a sample project to demonstrate the above. I hope this helps you.
Please let me know if you have any other questions or concerns on this matter.
Sincerely,AndrewAssociate DeveloperInfragistics Inc.www.infragistics.com/support
Thank you for your anwser.
You're right: the issue comes from the "re instanciation" of the page.