RadGrid saves some settings, but not all!

5 posts, 0 answers
  1. John
    John avatar
    43 posts
    Member since:
    Aug 2014

    Posted 11 Sep 2015 Link to this post

    I have a situation where the RadGrid Filter criteria is saved, but, the RadGrid doesn't execute the Filter expression (yes, I tried ReBind()) upon re-loading Persistence.  Also, Sorts are not re-loaded either.  Only the Filter criteria value is re-loaded upon returning to the page.

     

    I have a RadTabStrip with (3) RadGrids.  I implemented RadPersistenceManager with PersistenceSettings for each RadGrid, loading and saving with Page_Load and Page_Unload (code below, if needed).  Everything was working great; Sort & Filter were the same when I returned from exiting the app or returning from another page.  Something changed, though.  I'm not sure where.  The RadGrid Filter criteria is saved, but, the RadGrid doesn't execute the Filter expression, and the Sorts don't re-load.  What could've possibly happened to cause this?

     

     

     <telerik:RadPersistenceManager ID="RadPersistenceManager_AssetTabs" runat="server">
        <PersistenceSettings>
            <telerik:PersistenceSetting ControlID="RadGrid1" />
            <telerik:PersistenceSetting ControlID="RadGrid2" />
            <telerik:PersistenceSetting ControlID="RadGrid3" />
        </PersistenceSettings>
    </telerik:RadPersistenceManager>

     

    protected void Page_Load(object sender, EventArgs e)

    {
        string theKey = "TelerikAspNetRadControlsPersistedState";
        theKey = "StorageProvider_" + Session["UserName"].ToString();
        RadPersistenceManager_AssetTabs.StorageProviderKey = theKey;
        var fileNameAndPath = Server.MapPath("~/App_Data/" + theKey);

        //bool IsPersistenceLoaded = (bool)Session["PersistenceLoaded"];
        if (File.Exists(fileNameAndPath)) // && !IsPersistenceLoaded)
        {
            try
            {
                if (!IsPostBack)
                {
                    RadPersistenceManager_AssetTabs.LoadState();
                }
            }
            catch (Exception theError)
            {
                Console.WriteLine("Exception for RadPersistenceManager LoadState: {0}", theError);
            }
        }
    }

    protected void Page_Unload(object sender, System.EventArgs e)
    {
        try
        {
            RadPersistenceManager_AssetTabs.SaveState();
        }
        catch (Exception theError)
        {
            Console.WriteLine("Exception for RadPersistenceManager SaveState: {0}", theError);
        }
    }

  2. John
    John avatar
    43 posts
    Member since:
    Aug 2014

    Posted 14 Sep 2015 Link to this post

    *** Update with possible workaround ***

    In my post above, only the Filter criteria value was re-loaded upon returning to the page, not the Sorts, column resize, or executing the filter itself.  In other forum posts, they mentioned that you can't use Load On Demand coupled with the Persistence Manager.  I didn't have Load On Demand invoked, on these (3) RadGrids; however, I had OnNeedDataSource invoked.  Apparently, they are akin to each other.  So, I removed OnNeedDataSource and declaratively implemented DataSourceID="<objectDataSource>".  Problem solved for now.

     

    I implemented OnNeedDataSource because it was suggested to me, by Telerik Support, that in order to improve Filter/Sort/Paging performance, I must ​implement Advanced Data Binding using OnNeedDataSource.  Until I find out differently, Advanced Data Binding and Persistence Manager seem to be in conflict with each other.  Please advise.  Thank you.

     

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Angel Petrov
    Admin
    Angel Petrov avatar
    1006 posts

    Posted 15 Sep 2015 Link to this post

    Hello,

    I have already provided an answer in the official support ticket you have opened regarding this matter. As soon as we are able to resolve the matter you can share your findings with the community thus helping other members overwhelm such situations.

    Regards,
    Angel Petrov
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  5. Anthony
    Anthony avatar
    1 posts
    Member since:
    Sep 2013

    Posted 10 May Link to this post

    I'm currently working on implementing persistence as well and use OnNeedDataSource with various grids. Any followup regarding a solution to the issue discussed here?

     

    Regards

  6. Kostadin
    Admin
    Kostadin avatar
    1708 posts

    Posted 13 May Link to this post

    Hi Anthony,

    Generally there should be a problem persisting the grid setting in case you are using an advanced databinding. I prepared a small sample where the persistence is working correctly and attached it to this thread. Could you please give it a try and let me know how it differs from your real setup?

    Regards,
    Kostadin
    Telerik
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017