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

RegisterPersistenceProvider does not seem to be working

5 Answers 260 Views
PersistenceFramework
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
David
Top achievements
Rank 1
David asked on 02 Nov 2011, 04:01 AM

I have been trying to use the persistance provider to save filter settings in the RadGridView

I have been following the demo app that was made available in the forums called 'GridViewSerialization'

I set up the special property

ServiceProvider.RegisterPersistenceProvider<ICustomPropertyProvider>(typeof(RadGridView), new GridViewCustomPropertyProvider());

In the demo when you go to load or save the Grid settings you can set thru the code that is in the GridViewCustomPropertyProvider class that is set up by the RegisterPersistenceProvider method.  If I set up this code in my application it does not seem to properly register the custom property for for if I put a break point on the code below:

 

IsolatedStorageProvider provider = new IsolatedStorageProvider();
    provider.LoadFromStorage();

I cannot step into the GridViewCustomPropertyProvider class.  I seems that it did not register the code properly.  Is there some way to trouble shoot this

Thanks for your help!


 

5 Answers, 1 is accepted

Sort by
0
Alex Fidanov
Telerik team
answered on 04 Nov 2011, 08:23 AM
Hello David,

Yes, there are a couple of ways to troubleshoot this. You can check if a provider has registered by the using the ServiceProvider.ResolvePersistenceProvider method. You need to pass the type of the provider you wish to resolve as generic parameter and the type that it has been registered to :

ServiceProvider.ResolvePersistenceProvider<ICustomPropertyProvider>(typeof(RadGridView));

If you are using the IsolatedStorageProvider, you can also check the persistence storage and how many items it contains. You can do this using the PersistenceManager.GetStorage() static method and check its Count property.

One thing that I can think off the top of my head is to check whether you have set the PersistenceManager.StorageId property on the control itself, so that it is registered in the storage.

<telerik:RadTreeViewtelerik:PersistenceManager.StorageId="treeViewStorageId">

If you have already checked the above, another issue might be that the control has been unregistered. We currently have such issue, when the controls are unregistered from the store when their Unload event is raised (when they are removed from the visual tree). If this is the case, then we have already resolved this and will be available for Q3 2011.

Please let me know if you have questions on this matter.

Best wishes,
Alex Fidanov
the Telerik team

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

0
Reese
Top achievements
Rank 1
answered on 15 Dec 2011, 11:31 PM
I'm having similar problems getting the PersistanceManager to work with the GridView.
I've tried what you suggested, and when I check the PersistanceManager.GetStorage(), I get a count of zero.

I downloaded the sample project and that worked for me.

Is there something in my settings for the Gridview that would keep PersistanceManager from working.  Like, does Asynchronous data loading or paging cause problems?

<telerik:RadGridView Name="radGridView1" IsReadOnly="True" ItemsSource="{Binding ElementName=radDataPager1, Path=PagedSource}"
AutoGenerateColumns="False" DataLoadMode="Asynchronous" ColumnWidth="245" RowHeight="20" SelectionChanged="radGridView1_SelectionChanged"
CanUserFreezeColumns="False" CanUserInsertRows="False" SelectionMode="Extended" IsBusy="{Binding IsBusy}" Margin="4,2,76,26"
telerik:PersistenceManager.StorageId="MainGridView">

0
Petar Mladenov
Telerik team
answered on 20 Dec 2011, 06:33 PM
Hi Reese,

 Is it possible for you to send us an isolated sample showing this issue? (via new support ticket, or we could change this ticket's type to "GeneralFeedback"). This way we will be better able to investigate this and advice you. Thank you in advance for your cooperation.

All the best,
Petar Mladenov
the Telerik team

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

0
Reese
Top achievements
Rank 1
answered on 20 Dec 2011, 09:15 PM
Petar,

Thanks for the response. 
It's a big project and would take some time to split it out to a manageable sample.
Also, I already went ahead and just manually saved the group and sort descriptors without using the PersistanceManager - so the original problem is solved.

Thanks,

Reese
0
Petar Mladenov
Telerik team
answered on 23 Dec 2011, 09:06 AM
Hello,

We are glad to hear that you have resolved this issue on your own. On a side note, I guess you are aware of the PersistenceFramework demos. 
Feel free to ask if you need further assistance.

All the best,
Petar Mladenov
the Telerik team

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

Tags
PersistenceFramework
Asked by
David
Top achievements
Rank 1
Answers by
Alex Fidanov
Telerik team
Reese
Top achievements
Rank 1
Petar Mladenov
Telerik team
Share this question
or