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

Exception Encountered in Samples

2 Answers 74 Views
PersistenceFramework
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 07 Oct 2011, 08:43 PM
Hey Guys,

I seem to be having a lot of trouble getting the Persistence Framework to work at all.  No matter whether I try to use IsolatedStorage or a stream, I get the following exception when I try to load the persisted data:

"Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index"

Has anyone see this before, or know what I might possible be missing?

Thanks,
Mark

2 Answers, 1 is accepted

Sort by
0
Alex Fidanov
Telerik team
answered on 10 Oct 2011, 08:42 AM
Hi Mark,

I am not sure what your setup is, but here is the code that I am using and it is working as expected:

<TextBox telerik:PersistenceManager.StorageId="textBox" VerticalAlignment="Top"/>



this.Loaded += (s, e) =>
            {
                IsolatedStorageProvider provider = new IsolatedStorageProvider();
                provider.LoadFromStorage();
            };
 
            Application.Current.Exit += (s, e) =>
            {
                IsolatedStorageProvider provider = new IsolatedStorageProvider();
                provider.SaveToStorage();
            };
Please let me know what I am missing.

Regards,
Alex Fidanov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Mark
Top achievements
Rank 1
answered on 10 Oct 2011, 03:19 PM
Hi Alex,

Thanks for your reponse.  I have tried many things, some of which look exactly like you have posted.  I will submit a support ticket with my project.  Hopefully it will help provide the guidance I need.

Thanks,
Mark.
Tags
PersistenceFramework
Asked by
Mark
Top achievements
Rank 1
Answers by
Alex Fidanov
Telerik team
Mark
Top achievements
Rank 1
Share this question
or