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

Question about loading GridView

3 Answers 42 Views
PersistenceFramework
This is a migrated thread and some comments may be shown as answers.
Rayne
Top achievements
Rank 1
Rayne asked on 22 Feb 2012, 09:46 PM
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.

3 Answers, 1 is accepted

Sort by
0
Rayne
Top achievements
Rank 1
answered on 22 Feb 2012, 10:08 PM
Changing from stream to isolated storage seems to have done the trick.
0
Accepted
Tina Stancheva
Telerik team
answered on 27 Feb 2012, 03:28 PM
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 >>
0
Rayne
Top achievements
Rank 1
answered on 27 Feb 2012, 03:49 PM
Thanks. I was probably not resetting the position back to 0. I will try to remember that in the future.
Tags
PersistenceFramework
Asked by
Rayne
Top achievements
Rank 1
Answers by
Rayne
Top achievements
Rank 1
Tina Stancheva
Telerik team
Share this question
or