What would be the best way to Clone an XamGrid's column layout/settings (which are dynamic) to another XamGrid? Anything better than a foreach on the grids.columns and adding the columns via code-behind?
Any recommendations would be appreciated.
Thanks,
Ken
You can try the Control Persistence Framework.
This is a demo in the samples browser. It shows how to persist the settings of the whole gird and and then load them on another:http://labs.infragistics.com/silverlight/lobsamples/2010.2/#/Samples/ControlPersistence/KeyFeatures/PersistxamGridSettings
This is a link to the online documentation of the Control Persistence Framework:http://help.infragistics.com/NetAdvantage/Silverlight/2010.2/CLR4.0/?page=Infragistics_Control_Persistence_Framework.html
I hope that this will help you
Well, this is pretty slick for persisting properties for controls but I'm not sure if that is what I need.
I have XamGrid1 and XamGrid2. Neither have any columns at design time. There is also a Listbox of dynamic columns a user can check. As they check and uncheck columns, I dynamically add columns or remove columns to XamGrid1. There is another option, which occasionally would be clicked and I'd need to then clone just the column layout of XamGrid1 into XamGrid2. Not properties per say, but which columns are in the grid. I can add code to just add into both grids, but since XamGrid2 isn't used that often, I was hoping to avoid the overhead and only set its columns when required.
Does that make sense? Would that persistence framework work for me for this use case?
Thanks for responding!
Hi,
Yes that makes sense, and yes the PersistenceFramework should help you do exactly that.
You can pick and chooser what you want to save and load. So in this case, you would just save the XamGrid's Columns.
You can read more about the PersistenceFramework in our help here:
http://help.infragistics.com/NetAdvantage/Silverlight/2010.2/CLR4.0/?page=Infragistics_Control_Persistence_Framework.html
Hope this helps,
-SteveZ