Question about loading GridView

4 posts, 1 answers
  1. Rayne
    Rayne avatar
    241 posts
    Member since:
    Sep 2010

    Posted 22 Feb 2012 Link to this post

    Following the demo on GridView settings, I'm saving the declared column visibility when the user control loads. The user can then toggle which columns in the grid they want to see (and export). If they have gotten to a point where they want to reset all the columns back to the default (not all columns are visible by default), I have a link to reset the visibility, by loading the initial saved settings. This works the first time they click on it.

    Let's say they then change visibility again and again want to reset, it doesn't work. I'm guessing it's because the persistence manager thinks it's already loaded? How do I get it to re-load? I could do it the manual way, but I want to use persistence because I anticipate them wanting to keep these settings between sessions, so I might eventually persist to a file.
  2. Rayne
    Rayne avatar
    241 posts
    Member since:
    Sep 2010

    Posted 22 Feb 2012 Link to this post

    Changing from stream to isolated storage seems to have done the trick.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Answer
    Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 27 Feb 2012 Link to this post

    Hi Rayne,

    Using an isolated storage seems like the best option in your case as then you don't have to keep the stream containing the persisted settings between the sessions.

    However, you should be able to use a stream as well but before reloading you need to make sure that:
    •  the stream position is set to 0
    • the stream isn't cleared or rewritten and it still contains the persisted data.

    Greetings,
    Tina Stancheva
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  5. Rayne
    Rayne avatar
    241 posts
    Member since:
    Sep 2010

    Posted 27 Feb 2012 Link to this post

    Thanks. I was probably not resetting the position back to 0. I will try to remember that in the future.
Back to Top