Sometimes the users paint themselves into a corner and set up the UI in an unwanted way. I would like a way to clear settings (all would be fine, but the ability to clear only some would also be better).
Something like
IsolatedStorageProvider isoProvider = new IsolatedStorageProvider();
isoProvider.ClearStorage();
isoProvider.ClearStorage(“myGridView”);
This would remove the files from isolated storage and revert controls to default settings.
5 Answers, 1 is accepted
If you want to delete a particular file with settings, you can use the following code :
using (var store = IsolatedStorageFile.GetUserStoreForAssembly())
{
string fileName = "myGridView" + ".bin";
if (store.FileExists(fileName))
{
try
{
store.DeleteFile(fileName);
}
catch (Exception ex)
{
}
}
}
However, we had already considered this request and had implemented part of it. We added a method for deleting all of the saved settings in the IsolatedStorage for the application - IsolatedStorageProvider.DeleteIsolatedStorageFiles. It will be publicly available with the upcoming internal build.
Please let me know if you have questions on this matter.
Greetings,
Alex Fidanov
the Telerik team
Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!
In case you would like to extend the IsolatedStorageProvider class or create an extension method, you can use the PersistenceManager.GetStorage() method, which will return the registered controls with their storage ids.
Greetings,
Alex Fidanov
the Telerik team
Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

But can I revert the settings of my UI to default without having to restart the application?
Can you please elaborate on what you mean by restarting the application? Basically you can save the initial state of your user control on loading it for example and then you can load the persisted state using the PersistenceManager.Load method like described in this article.
All the best,
Tina Stancheva
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>
