Is there a way to preserve/save the expanded groups using isolated storage ?

4 posts, 1 answers
  1. Barry
    Barry avatar
    29 posts
    Member since:
    May 2016

    Posted 21 Jun Link to this post

    Is there a way to preserve the expanded groups *using isolated storage* ?....I managed to get the sorting saving, but not the user expanded groups, so that when the app is run again the groups that were expanded previously remain expanded as the user left them (which is a business requirement of our app).

    Thanks,

     

    Barry

  2. Stefan X1
    Admin
    Stefan X1 avatar
    514 posts

    Posted 22 Jun Link to this post

    Hello Barry,

    In order to expand the items of RadTreeListView when the control's settings are reloaded from the storage, you can call the ExpandHierarchyItem() method for each item needed. For achieving this, you can subscribe to the RowIsExpandedChanged event of the control. Within the event handler you can get the expanded item through the DataContext of the row and cast it to the needed object type. Please take a look at the snippet below.
    private void treeListView_RowIsExpandedChanged(object sender,
        Telerik.Windows.Controls.GridView.RowEventArgs e)
    {
        var item = e.Row.DataContext as Club;
    }

    After getting the item, you can save it somewhere and when the control is reloaded from the storage, iterate over all saved items and call the ExpandHierarchyItem() for each one.

    Additionally, you may find the Events topic useful on the matter.

    I hope this helps.

    All the best,
    Stefan X1
    Telerik
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Barry
    Barry avatar
    29 posts
    Member since:
    May 2016

    Posted 22 Jun in reply to Stefan X1 Link to this post

    I'm a little fuzzy on how the saved value is achieved and re-loaded using IsolatedStorage, based your suggestion....or are you saying to not use IsolatedStorage and use custom code to save the "IsExpanded" value of each object in the list, and then parse the objects int he list OnLoad and expand each based on the custom property ?

    If there's a way to do it using IsolatedStorage, then that is what I'm really after...

    Thanks,

    Barry

  5. Answer
    Stefan X1
    Admin
    Stefan X1 avatar
    514 posts

    Posted 24 Jun Link to this post

    Hi Barry,

    What I meant in my previous reply, is that you will have to implement some additional logic, so that the items of RadTreeListView are expanded when the control is reloaded. Please excuse me if I was not clear enough.

    All the best,
    Stefan X1
    Telerik
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Back to Top