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

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

2 Answers 78 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Michael Hilgers
Top achievements
Rank 1
Michael Hilgers asked on 21 Aug 2013, 06:39 AM
Hello everyone,

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:

public partial class SusGridView : RadGridView
    {
        public SusGridView()
            : base()
        {
            this.Loaded += new RoutedEventHandler(SusGridView_Loaded);
            this.Unloaded += new RoutedEventHandler(SusGridView_Unloaded);
        }
 
        void SusGridView_Loaded(object sender, RoutedEventArgs e)
        {
            IsolatedStorageProvider isoProvider = new IsolatedStorageProvider();
            isoProvider.LoadFromStorage();
        }
        void SusGridView_Unloaded(object sender, RoutedEventArgs e)
        {
            IsolatedStorageProvider isoProvider = new IsolatedStorageProvider();
            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:

System.IO.IsolatedStorage.IsolatedStorageException
Die Anwendungsidentität des Aufrufers kann nicht bestimmt werden.
   bei System.IO.IsolatedStorage.IsolatedStorage.InitStore(IsolatedStorageScope scope, Type appEvidenceType)
   bei System.IO.IsolatedStorage.IsolatedStorageFile.GetStore(IsolatedStorageScope scope, Type applicationEvidenceType)
   bei Telerik.Windows.Persistence.Storage.IsolatedStorageProvider.GetIsolatedStoreOverride() in c:\TB\105\WPF_Scrum\Release_SL\Sources\Frameworks\Persistence\Storage\IsolatedStorageProvider.cs:Zeile 267.
   bei Telerik.Windows.Persistence.Storage.IsolatedStorageProvider.LoadFromStorage(String[] fileNames) in c:\TB\105\WPF_Scrum\Release_SL\Sources\Frameworks\Persistence\Storage\IsolatedStorageProvider.cs:Zeile 178.
   bei Telerik.Windows.Persistence.Storage.IsolatedStorageProvider.LoadFromStorage() in c:\TB\105\WPF_Scrum\Release_SL\Sources\Frameworks\Persistence\Storage\IsolatedStorageProvider.cs:Zeile 164.
   bei MPWS.Controls.SusGridView.SusGridView_Loaded(Object sender, RoutedEventArgs e) in D:\Entwicklung\C#\Projects\MPWS\MPWS\Controls\SusGridView.xaml.cs:Zeile 20.
   bei MS.Internal.CoreInvokeHandler.InvokeEventHandler(UInt32 typeIndex, Delegate handlerDelegate, Object sender, Object args)
   bei MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName, UInt32 flags)
(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??

Anyone faces or facing the same problem and knows a solution?

Kind regards,
Michael

2 Answers, 1 is accepted

Sort by
0
Michael Hilgers
Top achievements
Rank 1
answered on 22 Aug 2013, 09:50 AM
No ideas, even not from the Telerik Team?
0
Yoan
Telerik team
answered on 26 Aug 2013, 07:57 AM
Hi Michael,

I have already answered you in the other thread you have posted on the same subject.

Regards,
Yoan
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
GridView
Asked by
Michael Hilgers
Top achievements
Rank 1
Answers by
Michael Hilgers
Top achievements
Rank 1
Yoan
Telerik team
Share this question
or