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

Restting the layout runtime

3 Answers 136 Views
PersistenceFramework
This is a migrated thread and some comments may be shown as answers.
Jonah
Top achievements
Rank 1
Jonah asked on 04 Dec 2015, 08:01 PM
    Is it possible to reset the layout of a wpf control at runtime. My scenario is that if I add a column to a persisted grid view the user will not be able to see it unless they delete their settings. Is there a way to reset to the default layout during runtime?

3 Answers, 1 is accepted

Sort by
0
Milena
Telerik team
answered on 08 Dec 2015, 09:11 AM
Hello Jonah,

It is possible to save and load the visual state of wpf controls using PersistenceFramework at runtime. You can take a look at our GridViewSerialization demo in our GitHub SDK repository where you can see how to implement ​Save and Load functionality of the RadGridView control's UI. 

Please take a look at the example and let us know if you have any other questions.

Regards,
Milena
Telerik
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 Feedback Portal and vote to affect the priority of the items
0
Jonah
Top achievements
Rank 1
answered on 08 Dec 2015, 03:12 PM

I am saving and loading the visual state already, what I would like to know is if there is a way to add say a column and have it show up when the user has already saved their settings without having them delete their settings first?

So the scenario is the visual state they saved loads when the program starts, if I happen to add a column the user must delete their settings and restart the program in order to see new columns. Is there a way around this?

0
Kiril Vandov
Telerik team
answered on 09 Dec 2015, 11:56 AM
Hello Jonah,

If I understand your scenario correctly your are having:
- Version1 of your application and the users have already saved they settings
- then you change the XAML and other thing on the application and ship Version2.
- your clients automatically loads their saved settings and remove your changes in Version2(expected).

If that is the case the behavior is fully expected as the RadPersistanceFramework saves and loads multiple properties from your UI in order to restore them in their previous state. Based on the provided information you are trying to create some kind of Push notification for your users. You could create an Application logic to lets say store a version variable in an IsolatedStorageFile and check it with the current version of your application. If the previous version of the app is V1 and your are running V2 project it will detect that and you could delete the existing settings or simply save them without loading them.

I hope this information helps.

Kind regards,
Kiril Vandov
Telerik
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 Feedback Portal and vote to affect the priority of the items
Tags
PersistenceFramework
Asked by
Jonah
Top achievements
Rank 1
Answers by
Milena
Telerik team
Jonah
Top achievements
Rank 1
Kiril Vandov
Telerik team
Share this question
or