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
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:RadTreeView
telerik:PersistenceManager.StorageId
=
"treeViewStorageId"
>
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 >>
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"
>
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 >>
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
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.
Petar Mladenov
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>