Using "telerik:PersistenceManager.StorageId" with derived GridView class

Michael Hilgers

i've a project with several radGridViews. Now i'd like, that the user settings in the gridViews (in my case the colum order) will be saved and restored on the next load of the application.

For this, i'm using the IsolatedStorageProvider.Load/SaveFromStorage() functions and this all works pretty fine. The settings are saved on gridView.Unloaded and restored on gridView.Loaded.

Now i didn't want to implement the Loaded and Unloaded events for EVERY SINGLE gridView in my project, because that's not the good way of programming and maintainability. So i created a derived gridView class called "SuSGridView".

Here it's code:

publicpartialclassSusGridView : RadGridView

{

publicSusGridView()

: base()

{

this.Loaded += newRoutedEventHandler(SusGridView_Loaded);

this.Unloaded += newRoutedEventHandler(SusGridView_Unloaded);

}

voidSusGridView_Loaded(objectsender, RoutedEventArgs e)

{

IsolatedStorageProvider isoProvider = newIsolatedStorageProvider();

isoProvider.LoadFromStorage();

}

voidSusGridView_Unloaded(objectsender, RoutedEventArgs e)

{

IsolatedStorageProvider isoProvider = newIsolatedStorageProvider();

isoProvider.SaveToStorage();

}

}

Now when i change the XAML of one of my pages holding a grid from "<telerik:radGridView .....> to "<my:SusGridView ....>", it crashes on loading in designer and on loading on runtime with the following error:

(the second row of the error message is in german and means something like "the application identity of the caller cannot be determinded")

If i remove the "telerik:PersistenceManager.StorageId="nameOfGridView"" property, it works exactly flawless like before with the "<telerik:radGridView ....>" except the save and restore functionality of the user settings (because now the StorageId is missing). So the property "StorageId" seems not to work with derived gridView classes??

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks or appropriate markings.