RegisterPersistenceProvider does not seem to be working

6 posts, 0 answers
  1. David
    David avatar
    4 posts
    Member since:
    Jan 2011

    Posted 01 Nov 2011 Link to this post

    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!


     

  2. Alex Fidanov
    Admin
    Alex Fidanov avatar
    636 posts

    Posted 04 Nov 2011 Link to this post

    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 >>

  3. DevCraft banner
  4. Reese
    Reese avatar
    2 posts
    Member since:
    Dec 2011

    Posted 15 Dec 2011 Link to this post

    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">

  5. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 20 Dec 2011 Link to this post

    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 >>

  6. Reese
    Reese avatar
    2 posts
    Member since:
    Dec 2011

    Posted 20 Dec 2011 Link to this post

    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
  7. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 23 Dec 2011 Link to this post

    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 >>

Back to Top
DevCraft banner