This is a migrated thread and some comments may be shown as answers.

Save GridView Settings to XML

1 Answer 88 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Ryan
Top achievements
Rank 1
Ryan asked on 05 May 2011, 11:28 PM
Hi,

I have a requirement that I need to allow any user who uses our silverlight gridview app the ability to save the report with the filters/groupings/settings.  But they need to be able to see those settings regardless of what computer they are on, so I need to be able to save them to probably XML, and then either save them to a public share or ideally, back to a database to retreive.

I suppose I see:
taking the existing RadGridViewSettings.cs file and converting it so that instead of saving it to the isolated storage, it is instead saving it as a string of XML.

I could then pass that string via a web service and save it to my database as part of my settings table.

Then do the reverse to load those settings.

Does this seem possible?

1 Answer, 1 is accepted

Sort by
0
Milan
Telerik team
answered on 06 May 2011, 08:29 AM
Hi Ryan,

This is indeed possible. If you look at the Save method you will notice that the data is serialized into a stream which can stored anywhere - using Isolated Storage is just one option.

using (IsolatedStorageFileStream stream = new IsolatedStorageFileStream(PersistID, FileMode.Create, file))
                        {
                            serializer.WriteObject(stream, this);
                        }

Keep in my that Silverlight application do not have access to the full file system and storing and retrieving information from and to random files can be tricky. You may try saving the setting is a database. 


Best wishes,
Milan
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
GridView
Asked by
Ryan
Top achievements
Rank 1
Answers by
Milan
Telerik team
Share this question
or