We are using a xamDataGrid (v12.2) where the user can show or hide specific columns (toggles the visibility). We are binding to a hierarchical observable collection so a user also has the ability to expand or collapse a variety of rows.
When we rebind to our data source we need to save the layout of the grid and then load it after we bind to the new data source so that the grid appears the same with possibly some different data. For example, the column visibility as well as which rows are expanded or collapsed will need to be unchanged after rebinding to the new data source. We will also want to save the grid layout per user so that a given user can save their personal grid customizations. What would be the best way to accomplish this?
Thanks
Any chance of persisting (SaveCustomizations/LoadCustomizations) the XamDataGrid's expand/collapse has been added to a release since the above question. If not could you provide a solution/demo that others have used to implement this functionality.
Hi Matt,
Thank you for your post. I was able to solve my issue using some ideas in your sample solution.
Thanks,
HI ,
Please let me know if you need further assistance regarding this issue.
Sincerely,
Matt
Developer Support Engineer
HI,
You can use the the XamDataGrid's Load and SaveCustomizations method to save the layout changes made by the user. It will not save row expansion information.
You could keep track of that information by sotring on the datasource the XamDataGrid is bound to, or storing it in another collection writing this collection out to disk and reloading it. I am attaching a sample that saves the expansion information in the collection the grid is bound to.
Sincerely, Matt Developer Support Engineeer