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

Persistence Framework Questions

3 Answers 348 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Ben
Top achievements
Rank 1
Ben asked on 05 Aug 2013, 04:57 PM
Please forgive my lack of understanding on how the Persistence Framework functions.

I have an application where I allow users to set what columns on a Grid View are visible or hidden.  When they close the application, I want to save their preferences.  When they open the application, I want to reload their preferences from the last time they used the program. 

This seems like a good job for Persistence Framework.  I began by looking at this WPF online help example:http://www.telerik.com/help/wpf/persistence-framework-getting-started.html

The code that saves my Grid View layout as a stream seems to be working, however, I'm having trouble reloading the layout once the application has been closed and re-opened.  When I re-open the application my Stream object is nothing, so the PersistenceManager.Load method throws an error.  I don't understand how to retrieve my saved Grid View Layout.

Can you describe how Persistence Framework functions, and help me understand how I retrieve and apply my saved Grid View layout?

Any assistance is greatly appreciated.  Thank you.

3 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 08 Aug 2013, 01:05 PM
Hello,

If you save the settings in a stream field in your application, then when you restart it, the field's value will be nothing and this is expected.
Please note that you should save the stream outside of the application - in a file (for example an XML file), in a Database or in IsolatedStorage. This help article on saving the layout of UIElements in an isolated storage might be helpful .

I would suggest you to also check the "GridView Serialization" WPF Demo and check how the data is 
applied back to the RadGridView. 

 
Regards,
Didie
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Curtis
Top achievements
Rank 1
answered on 27 Sep 2013, 04:59 PM
I also want to save the grid settings between sessions. This includes grouping, column order, etc. I used the GridView Serialization example to store the grid settings in a stream, but I'm not sure how to save the stream to storage. Can you give an example or is it possible to use the Isolated storage to save grouping. By default the telerik isolated storage does not save grouping.

Thanks,
Curtis
0
Dimitrina
Telerik team
answered on 30 Sep 2013, 06:51 AM
Hello Curtis,

Please note that you can save the stream outside of the application - in a file (for example an XML file), in a Database or in IsolatedStorage. This help article on saving the layout of UIElements in an isolated storage might be helpful .
 
As to saving and restoring the groups' states, you can go through this forum thread. It is for Silverlight, but the same approach can be applied for WPF.

Regards,
Didie
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
GridView
Asked by
Ben
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Curtis
Top achievements
Rank 1
Share this question
or