Restting the layout runtime

4 posts, 0 answers
  1. Jonah
    Jonah avatar
    21 posts
    Member since:
    Oct 2012

    Posted 04 Dec 2015 Link to this post

        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?
  2. Milena
    Admin
    Milena avatar
    201 posts

    Posted 08 Dec 2015 Link to this post

    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
  3. UI for WPF is Visual Studio 2017 Ready
  4. Jonah
    Jonah avatar
    21 posts
    Member since:
    Oct 2012

    Posted 08 Dec 2015 Link to this post

    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?

  5. Kiril Vandov
    Admin
    Kiril Vandov avatar
    324 posts

    Posted 09 Dec 2015 Link to this post

    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
Back to Top