Hi there,
I have a strange issue that is haunting me and I hope you can help
I am using the XamGrid persistence Settings functionality to allow users to save and load grid settings at will, and this works fine.
The problem comes when people "share" settings... i.e user 1 creates a layout of the grid that they like, and clicks save. In my application this will grab the persistence settings from the grid, throw it into a Byte[], and save it to the Database. When this user loads up the application again, the settings are retrieved and loaded with no problem. Very slick!
User 2 also likes the look of the grid, so User 1 makes the database entry shared, so User 2 can now access his settings.
When user 2 loads up the application, the settings are retrieved correctly, but when they are applied to the grid, the grid goes blank.. No columns, no headers, no nothing at all...
I am wondering what is causing this issue as it is severaly impacting a project I am working on.
Does the persistence settings take some kind of GUID from the Grid?
If so, how can I resolve this problem?
Thanks
Sorry to bump, but was really hoping to get a response to this..
Hello Matt,
Thank you for your post. I have been looking into it and I can suggest you see the sample in the Samples Browser under Persistence Framework / Organization / Persist xamGrid Settings section, where there is a sample showing how to save settings from one grid and apply them to another one. Please let me know if this helps you or you need further assistance on this matter.
Looking forward for your reply.
Thanks for the reply, however the snippet here:
private void btnSaveState_Click(object sender, RoutedEventArgs e) { // Saves all sourceDataGrid properties // except Rows, ActiveCell, SelectedCells, SelectedRows (ignored by default) MemoryStream memoryStream = PersistenceManager.Save(sourceDataGrid); memoryStream.Position = 0; // Loads all saved properties from sourceDataGrid to targetDataGrid PersistenceManager.Load(targetDataGrid, memoryStream);
Only works on the SAME machine in the same instance of the application run...
I am persisting settings in a Database so that they are saved across sessions. This works perfectly except when settings are shared between machines.
To clarify:
User 1 saves Grid Settings 1 in the DB. Each time he loads the grid, it works Perfectly.
User 2 loads up a Grid, and applies Grid Settings 1 from the DB, and the grid goes completely blank and cannot be reset.
Thanks for the assistance,
Matt.
Another way of thinking about it is this:
In a Database there is a Persistence setting for a XamGrid. Every user has access to this, and on loading up the application, this grid settings are queried and applied to the grid.
The problem, is that the settings will only work for the 1 user that actually saved the setting from their grid... no one else. (hence me thinking it must be some kind of guid or identifier from somewhere... )
I appreciate this is a non-trivial issue to replicate or offer a coded solution to, but I really would appreciate the help..
Thanks again,
There isn't any unique number that is saved in the file, but if you send me an isolated sample project, where this is reproduced or at least a code snippet of your XamGRid definition and the code that loads the data and save/load the settings I would be able to investifate this further.
Excellent thanks!
I really hope this is picked up as the persistence stuff is really cool and my users love it when it works ;)
After some research Load XamGrid if persist fail has been determine as a new Product Idea. I have sent your Product Idea directly to our product management team. Our product team chooses new Product Ideas for development based on popular feedback from our customer base. Infragistics continues to monitor application development for all of our products, so as trends appear in requested ideas, we can plan accordingly.
We value your input, and our philosophy is to enhance our toolset based on customer feedback. If your idea is chosen for development, you will be notified at that time. Your reference number for this Product Idea is PI13050081
If you would like to follow up on your Product Idea at a later point, you may contact Developer Support management via email. Please include the reference number of your Product Idea in the subject and body of your email message. You can reach Developer Support management through the following email address: dsmanager@infragistics.com
The Peristence settings are stored in a PersistenceObject type, so it would be great is there was a simple way to traverse the XML to remove any reference to grid columns that no longer exist in the collection..
The Xml looks like:
<?xml version="1.0" encoding="utf-8"?><PersistenceObject xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <Xml><?xml version="1.0" encoding="utf-16"?><GroupData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <TypeStore> <TypeDataPair> <LookupKey>-1474381838</LookupKey> <TypeName>Infragistics.Controls.Grids.SortDirection, InfragisticsSL5.Controls.Grids.XamGrid.v12.1, Version=12.1.20121.1016, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb</TypeName> </TypeDataPair> <TypeDataPair> <LookupKey>219087292</LookupKey> <TypeName>System.Windows.Visibility, System.Windows, Version=5.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e</TypeName> </TypeDataPair> <TypeDataPair>
etc etc... with a section of string entries defining the columns expected in the grid, and data links back to (presumably) the action to be performed on the grid item/column in question.
If these properties were exposed from the PersistenceObject, this would be trivial..
Cheers,
Hi There!
In trying to create a scenario where I could test your suggestion, I kind of stumbled across the answer...
My Grid settings are saving the entire layout.. Columns and all.. and it seems that between releases, or even between sessions, depending on whether use has gotten the latest verison of the Silverlight Client, the Grid Columns may be different.
This makes total sense now. However, it leaves me with a huge problem.
Our grid is the central driving data component of our application. And currently, there are 3 of them, and this will increase in the future, and the ability to store Grid Settings, and apply them without things exploding is a requirement.
My assumption was that the resulting XML of the Persistence settings would only work on the Columns that were Defined AND present, not blow up if a column appeared that was not defined, or defined but no longer present... Can I consider this a bug?
At least, is there a way to detect if the settings being applied do not match up with the Grid in the application?
That way, I could fail the grid settings application early, and give a message saying that they need to update the grid settings....
Or alternatively, is there a way to remove the resulting grid white out if this DOES happen...
Eagerly awaiting a reply!
Many thanks
I am looking forward to hear from you.