I have two datagrids with the same datasource on different pages using MVVM. I want when the user selects an active record and goes to the next page that record is selected on the next datagrid. I tried binding to ActiveRecord however I got an error when passing active record to the next grid because it's not the same grid. Is there a way I can use ActiveDataItem?
Hello,
I am just checking the progress of this issue and was wondering if you managed to achieve your goal or if you need any further assistance on the matter.
Yes thank you
Thank you for your feedback. I am glad that you resolved your issue and I believe that other community members may benefit from this as well.
Thanks again.
I got it working now. Thanks
I have modified the sample you sent me, so now it works as you want. Basically the objects in the two collections should be the same if you want the ActiveDataItem to work correctly.
Hope this helps you.
This was helpful however one of my scenerios is instead of having both datagrid datasources pointing to the same property they will be pointing to different properties but same data. I modified the project to explain. The reason why is I have a navigation function that will pass data the from one page to another and I want whatever selected on the first page to be selected on the next.
I have modified the sample further, so now it has the functionality you want. Basically I implemented the INotifyPropertyChanged interface in the ViewModel class, so now the UI could be notified when the ActivePerson changes. Here you can find more information about this interface:
http://msdn.microsoft.com/en-us/library/system.componentmodel.inotifypropertychanged.aspx