I am working with the XamDataGrid in MVVM Context. My problem is that when i change tabs (i.e. DataContextChanged) and then click back on the original tab, all of the expanders that were clicked are now collapsed and the header that I last clicked to sort did not persist.
I have tried saving sort descriptions in the ViewModel which works okay. For the expanders, I have tried saving the indexes of the expanded rows and re-expand iteritavely when the switching back. This seems hackish and there is a bit of delay. Worst of all when I have a XamDataGrid that has records with expanders nested insided other expanders, I cannot seem to target the nested rows to expand them programmatically.
Is there a way to persist the sort info and which rows were expanded declaratively like a binding property in the ViewModel?
Hello,
I am just checking if you got this worked out or you still require any assistance or clarification on the matter.
Thank you for your post. I have been looking through it and I suggest you see this forum thread:
http://blogs.infragistics.com/forums/p/55930/286883.aspx
where a similar issue like yours is discussed. Also if you need to iterate trough all the Records of the XamDataGrid, here it is explained how to do so:
http://help.infragistics.com/NetAdvantage/WPF/2011.1/CLR4.0/?page=xamDataPresenter_Iterate_through_the_Records_Collection.html.
Please let me know if you need further clarifications on this matter.
Looking forward for your reply.