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

Any option to save Role specific information or user data with the persistance framework

1 Answer 21 Views
PersistenceFramework
This is a migrated thread and some comments may be shown as answers.
Abhilash
Top achievements
Rank 1
Abhilash asked on 26 Apr 2013, 05:35 AM
Hello,

Got a question- if we have any option in which we can save user data with persistance framework so that next time if that user logs in than he can see his own saved layout,means role based options?

If there is any please suggest.

Thanks.

Regards,

Abhilash

1 Answer, 1 is accepted

Sort by
0
Tina Stancheva
Telerik team
answered on 30 Apr 2013, 11:29 AM
Hi Abhilash,

The RadPeriststenceFramework can save the UI state of UIElements and this is why you can use it to persist the UI settings of any layout. And in case you need to associate a persisted layout with a user, you can do so using one of two approaches:
  • save the UI state of the layout in a stream and save the stream along with the user ID/Name in a database in a single record. Then you can use the UserId/Name to retrieve the stream with the persisted data of a particular user and load it in the view.
  • save the UI state of the layout in an IsolatedStorage but make sure to apply a StorageId on your view that reflects the UserId/Name. You can use data-binding and bind the StorageId property to a property that reflects the user identity. This way you will be able to save the layout in different files in an isolated storage - one file per user.

However, please note that the RadPeriststenceFramework cannot save any databindings, it will only save the current value of a UIProperty. This is why it is usually recommended to use both approaches - the PersistenceFramework to save the UI visual state - background, foreground, font styles, even selections; and all data-related values bound to ViewModels and restore them from your business data.


Kind regards,
Tina Stancheva
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
PersistenceFramework
Asked by
Abhilash
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
Share this question
or