telerik radGrid - persist client state on sort/paging/filter












4















Even in this ajax example
which I really like the look of, when ever the top level grid is sorted the "state" of what you were doing "disappears"



For example,




Open the first person's row (Nancy Davolio) so you can see the Sales grid



Sort by Order Total in the Sales grid



Sort by Birth Date in the top level grid



Nancy Davoilo should now be second. Open her row.



The sales grid is no longer sorted by Order Total




This may seem trivial, or that i'm being picky; However:



If I have some text box(or some other type of method of accepting user input) on the sales grid, I would assume that this would get destroyed when sorting the top level grid.
I would also think that even if I had this input on the top level grid, that sorting the top level grid (or filtering if there were filters) would destroy this input.



It seems that even paging destroys this.



The desired behavior would be for sorting and paging not just "appear" to be done client side because it's using an ajax request, but to ACTUALLY be done client side. Meaning that the actual rows of the grid are literally sorted(filtered, paged, etc.) client side so that any client side changes such as adding text to a text box, adding a css class to an object, [or in a more complex example adding a reference to a javascript object to an object via Jquery: $("#div1").data("object",someObject) would persist after sorting, paging and filtering.



Is there a way to make this happen?



Am I making what i'm looking to do clear? If not i'm happy to clarify.



Additional Notes: I would think the client side performance hit would be minimal to do something like this as long as there were not a very large number of rows. In fact there would be a lot less work on the server in recreating all of the records, repeated calls to the server/database and as in my example at the top the subPages would only need to be created once rather than twice.










share|improve this question

























  • I have this sad feeling that the answer to this is that there is no telerik supported way to do this. I'm think i could just remove telerik paging, let it create all the rows for me and then hide and show to do paging myself. (can I manually control the telerik paging control?) Same for sorting, just have a function that takes in all the ids of the rows and sorts then on the col, and then returns the sorted list of ids, and then I just change the order... I think I can do this efficiently all client side? Although at that point whats the point of using the telerik grid?

    – kralco626
    May 18 '11 at 11:57
















4















Even in this ajax example
which I really like the look of, when ever the top level grid is sorted the "state" of what you were doing "disappears"



For example,




Open the first person's row (Nancy Davolio) so you can see the Sales grid



Sort by Order Total in the Sales grid



Sort by Birth Date in the top level grid



Nancy Davoilo should now be second. Open her row.



The sales grid is no longer sorted by Order Total




This may seem trivial, or that i'm being picky; However:



If I have some text box(or some other type of method of accepting user input) on the sales grid, I would assume that this would get destroyed when sorting the top level grid.
I would also think that even if I had this input on the top level grid, that sorting the top level grid (or filtering if there were filters) would destroy this input.



It seems that even paging destroys this.



The desired behavior would be for sorting and paging not just "appear" to be done client side because it's using an ajax request, but to ACTUALLY be done client side. Meaning that the actual rows of the grid are literally sorted(filtered, paged, etc.) client side so that any client side changes such as adding text to a text box, adding a css class to an object, [or in a more complex example adding a reference to a javascript object to an object via Jquery: $("#div1").data("object",someObject) would persist after sorting, paging and filtering.



Is there a way to make this happen?



Am I making what i'm looking to do clear? If not i'm happy to clarify.



Additional Notes: I would think the client side performance hit would be minimal to do something like this as long as there were not a very large number of rows. In fact there would be a lot less work on the server in recreating all of the records, repeated calls to the server/database and as in my example at the top the subPages would only need to be created once rather than twice.










share|improve this question

























  • I have this sad feeling that the answer to this is that there is no telerik supported way to do this. I'm think i could just remove telerik paging, let it create all the rows for me and then hide and show to do paging myself. (can I manually control the telerik paging control?) Same for sorting, just have a function that takes in all the ids of the rows and sorts then on the col, and then returns the sorted list of ids, and then I just change the order... I think I can do this efficiently all client side? Although at that point whats the point of using the telerik grid?

    – kralco626
    May 18 '11 at 11:57














4












4








4








Even in this ajax example
which I really like the look of, when ever the top level grid is sorted the "state" of what you were doing "disappears"



For example,




Open the first person's row (Nancy Davolio) so you can see the Sales grid



Sort by Order Total in the Sales grid



Sort by Birth Date in the top level grid



Nancy Davoilo should now be second. Open her row.



The sales grid is no longer sorted by Order Total




This may seem trivial, or that i'm being picky; However:



If I have some text box(or some other type of method of accepting user input) on the sales grid, I would assume that this would get destroyed when sorting the top level grid.
I would also think that even if I had this input on the top level grid, that sorting the top level grid (or filtering if there were filters) would destroy this input.



It seems that even paging destroys this.



The desired behavior would be for sorting and paging not just "appear" to be done client side because it's using an ajax request, but to ACTUALLY be done client side. Meaning that the actual rows of the grid are literally sorted(filtered, paged, etc.) client side so that any client side changes such as adding text to a text box, adding a css class to an object, [or in a more complex example adding a reference to a javascript object to an object via Jquery: $("#div1").data("object",someObject) would persist after sorting, paging and filtering.



Is there a way to make this happen?



Am I making what i'm looking to do clear? If not i'm happy to clarify.



Additional Notes: I would think the client side performance hit would be minimal to do something like this as long as there were not a very large number of rows. In fact there would be a lot less work on the server in recreating all of the records, repeated calls to the server/database and as in my example at the top the subPages would only need to be created once rather than twice.










share|improve this question
















Even in this ajax example
which I really like the look of, when ever the top level grid is sorted the "state" of what you were doing "disappears"



For example,




Open the first person's row (Nancy Davolio) so you can see the Sales grid



Sort by Order Total in the Sales grid



Sort by Birth Date in the top level grid



Nancy Davoilo should now be second. Open her row.



The sales grid is no longer sorted by Order Total




This may seem trivial, or that i'm being picky; However:



If I have some text box(or some other type of method of accepting user input) on the sales grid, I would assume that this would get destroyed when sorting the top level grid.
I would also think that even if I had this input on the top level grid, that sorting the top level grid (or filtering if there were filters) would destroy this input.



It seems that even paging destroys this.



The desired behavior would be for sorting and paging not just "appear" to be done client side because it's using an ajax request, but to ACTUALLY be done client side. Meaning that the actual rows of the grid are literally sorted(filtered, paged, etc.) client side so that any client side changes such as adding text to a text box, adding a css class to an object, [or in a more complex example adding a reference to a javascript object to an object via Jquery: $("#div1").data("object",someObject) would persist after sorting, paging and filtering.



Is there a way to make this happen?



Am I making what i'm looking to do clear? If not i'm happy to clarify.



Additional Notes: I would think the client side performance hit would be minimal to do something like this as long as there were not a very large number of rows. In fact there would be a lot less work on the server in recreating all of the records, repeated calls to the server/database and as in my example at the top the subPages would only need to be created once rather than twice.







javascript jquery html telerik radgrid






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Oct 11 '16 at 6:23









winterfruit

178214




178214










asked May 18 '11 at 11:54









kralco626kralco626

3,8383194159




3,8383194159













  • I have this sad feeling that the answer to this is that there is no telerik supported way to do this. I'm think i could just remove telerik paging, let it create all the rows for me and then hide and show to do paging myself. (can I manually control the telerik paging control?) Same for sorting, just have a function that takes in all the ids of the rows and sorts then on the col, and then returns the sorted list of ids, and then I just change the order... I think I can do this efficiently all client side? Although at that point whats the point of using the telerik grid?

    – kralco626
    May 18 '11 at 11:57



















  • I have this sad feeling that the answer to this is that there is no telerik supported way to do this. I'm think i could just remove telerik paging, let it create all the rows for me and then hide and show to do paging myself. (can I manually control the telerik paging control?) Same for sorting, just have a function that takes in all the ids of the rows and sorts then on the col, and then returns the sorted list of ids, and then I just change the order... I think I can do this efficiently all client side? Although at that point whats the point of using the telerik grid?

    – kralco626
    May 18 '11 at 11:57

















I have this sad feeling that the answer to this is that there is no telerik supported way to do this. I'm think i could just remove telerik paging, let it create all the rows for me and then hide and show to do paging myself. (can I manually control the telerik paging control?) Same for sorting, just have a function that takes in all the ids of the rows and sorts then on the col, and then returns the sorted list of ids, and then I just change the order... I think I can do this efficiently all client side? Although at that point whats the point of using the telerik grid?

– kralco626
May 18 '11 at 11:57





I have this sad feeling that the answer to this is that there is no telerik supported way to do this. I'm think i could just remove telerik paging, let it create all the rows for me and then hide and show to do paging myself. (can I manually control the telerik paging control?) Same for sorting, just have a function that takes in all the ids of the rows and sorts then on the col, and then returns the sorted list of ids, and then I just change the order... I think I can do this efficiently all client side? Although at that point whats the point of using the telerik grid?

– kralco626
May 18 '11 at 11:57












2 Answers
2






active

oldest

votes


















0














Take a look at the HierarchyLoadMode property of the MasterTableView. The demo you reference is using HierarchyLoadMode.ServerOnDemand which, according to Telerik's documentation, means that ViewState only maintains the state of the visible items. Therefore, when a details grid is collapsed you will lose its state (e.g. a sort order, page number, etc).



There are other modes. You can choose HierarchyLoadMode.ServerBind which maintains ViewState for all detail tables but requires a PostBack to expand a detail table. The HierarchyLoadMode.Client renders the MasterTableView and all DetailTables and items are expanded/collapsed on the client - no PostBack required. Either of those modes should also maintain the sort order and other state related to the detail tables.



I hope that helps answer your question.






share|improve this answer
























  • However, that example, and in the case I'm trying to implement, there is no details grid. Instead a Nested View template is used that comtains a panel that contains some RadPageViews which contain a div of information and another RadGrid... My point being that there is no actual Hierarchical load, however I will try the setting and let you know of the effect.

    – kralco626
    May 19 '11 at 10:08











  • All that did was make it take a really long time to load the main grid (or sort it) because it had to load all the girds that were contained in the pagviews, and make drilling down to see a rows pageview really fast. As for any of those issues there was no change in effect.

    – kralco626
    May 19 '11 at 10:16



















0














I recently got a reply from the Telerik support that their AJAX grid supports client binding out-of-the-box with sorting, paging and filtering with flat structure only (as in this demo).



For your case you may have two options:




  • extend the example with grid settings persister - http://demos.telerik.com/aspnet-ajax/grid/examples/programming/savinggridsettingsonperuserbasis/defaultcs.aspx

  • implement custom solution to simulate hierarchy with client binding as presented in this blog post.






share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f6044259%2ftelerik-radgrid-persist-client-state-on-sort-paging-filter%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    Take a look at the HierarchyLoadMode property of the MasterTableView. The demo you reference is using HierarchyLoadMode.ServerOnDemand which, according to Telerik's documentation, means that ViewState only maintains the state of the visible items. Therefore, when a details grid is collapsed you will lose its state (e.g. a sort order, page number, etc).



    There are other modes. You can choose HierarchyLoadMode.ServerBind which maintains ViewState for all detail tables but requires a PostBack to expand a detail table. The HierarchyLoadMode.Client renders the MasterTableView and all DetailTables and items are expanded/collapsed on the client - no PostBack required. Either of those modes should also maintain the sort order and other state related to the detail tables.



    I hope that helps answer your question.






    share|improve this answer
























    • However, that example, and in the case I'm trying to implement, there is no details grid. Instead a Nested View template is used that comtains a panel that contains some RadPageViews which contain a div of information and another RadGrid... My point being that there is no actual Hierarchical load, however I will try the setting and let you know of the effect.

      – kralco626
      May 19 '11 at 10:08











    • All that did was make it take a really long time to load the main grid (or sort it) because it had to load all the girds that were contained in the pagviews, and make drilling down to see a rows pageview really fast. As for any of those issues there was no change in effect.

      – kralco626
      May 19 '11 at 10:16
















    0














    Take a look at the HierarchyLoadMode property of the MasterTableView. The demo you reference is using HierarchyLoadMode.ServerOnDemand which, according to Telerik's documentation, means that ViewState only maintains the state of the visible items. Therefore, when a details grid is collapsed you will lose its state (e.g. a sort order, page number, etc).



    There are other modes. You can choose HierarchyLoadMode.ServerBind which maintains ViewState for all detail tables but requires a PostBack to expand a detail table. The HierarchyLoadMode.Client renders the MasterTableView and all DetailTables and items are expanded/collapsed on the client - no PostBack required. Either of those modes should also maintain the sort order and other state related to the detail tables.



    I hope that helps answer your question.






    share|improve this answer
























    • However, that example, and in the case I'm trying to implement, there is no details grid. Instead a Nested View template is used that comtains a panel that contains some RadPageViews which contain a div of information and another RadGrid... My point being that there is no actual Hierarchical load, however I will try the setting and let you know of the effect.

      – kralco626
      May 19 '11 at 10:08











    • All that did was make it take a really long time to load the main grid (or sort it) because it had to load all the girds that were contained in the pagviews, and make drilling down to see a rows pageview really fast. As for any of those issues there was no change in effect.

      – kralco626
      May 19 '11 at 10:16














    0












    0








    0







    Take a look at the HierarchyLoadMode property of the MasterTableView. The demo you reference is using HierarchyLoadMode.ServerOnDemand which, according to Telerik's documentation, means that ViewState only maintains the state of the visible items. Therefore, when a details grid is collapsed you will lose its state (e.g. a sort order, page number, etc).



    There are other modes. You can choose HierarchyLoadMode.ServerBind which maintains ViewState for all detail tables but requires a PostBack to expand a detail table. The HierarchyLoadMode.Client renders the MasterTableView and all DetailTables and items are expanded/collapsed on the client - no PostBack required. Either of those modes should also maintain the sort order and other state related to the detail tables.



    I hope that helps answer your question.






    share|improve this answer













    Take a look at the HierarchyLoadMode property of the MasterTableView. The demo you reference is using HierarchyLoadMode.ServerOnDemand which, according to Telerik's documentation, means that ViewState only maintains the state of the visible items. Therefore, when a details grid is collapsed you will lose its state (e.g. a sort order, page number, etc).



    There are other modes. You can choose HierarchyLoadMode.ServerBind which maintains ViewState for all detail tables but requires a PostBack to expand a detail table. The HierarchyLoadMode.Client renders the MasterTableView and all DetailTables and items are expanded/collapsed on the client - no PostBack required. Either of those modes should also maintain the sort order and other state related to the detail tables.



    I hope that helps answer your question.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered May 19 '11 at 2:10









    Kevin BabcockKevin Babcock

    6,564186183




    6,564186183













    • However, that example, and in the case I'm trying to implement, there is no details grid. Instead a Nested View template is used that comtains a panel that contains some RadPageViews which contain a div of information and another RadGrid... My point being that there is no actual Hierarchical load, however I will try the setting and let you know of the effect.

      – kralco626
      May 19 '11 at 10:08











    • All that did was make it take a really long time to load the main grid (or sort it) because it had to load all the girds that were contained in the pagviews, and make drilling down to see a rows pageview really fast. As for any of those issues there was no change in effect.

      – kralco626
      May 19 '11 at 10:16



















    • However, that example, and in the case I'm trying to implement, there is no details grid. Instead a Nested View template is used that comtains a panel that contains some RadPageViews which contain a div of information and another RadGrid... My point being that there is no actual Hierarchical load, however I will try the setting and let you know of the effect.

      – kralco626
      May 19 '11 at 10:08











    • All that did was make it take a really long time to load the main grid (or sort it) because it had to load all the girds that were contained in the pagviews, and make drilling down to see a rows pageview really fast. As for any of those issues there was no change in effect.

      – kralco626
      May 19 '11 at 10:16

















    However, that example, and in the case I'm trying to implement, there is no details grid. Instead a Nested View template is used that comtains a panel that contains some RadPageViews which contain a div of information and another RadGrid... My point being that there is no actual Hierarchical load, however I will try the setting and let you know of the effect.

    – kralco626
    May 19 '11 at 10:08





    However, that example, and in the case I'm trying to implement, there is no details grid. Instead a Nested View template is used that comtains a panel that contains some RadPageViews which contain a div of information and another RadGrid... My point being that there is no actual Hierarchical load, however I will try the setting and let you know of the effect.

    – kralco626
    May 19 '11 at 10:08













    All that did was make it take a really long time to load the main grid (or sort it) because it had to load all the girds that were contained in the pagviews, and make drilling down to see a rows pageview really fast. As for any of those issues there was no change in effect.

    – kralco626
    May 19 '11 at 10:16





    All that did was make it take a really long time to load the main grid (or sort it) because it had to load all the girds that were contained in the pagviews, and make drilling down to see a rows pageview really fast. As for any of those issues there was no change in effect.

    – kralco626
    May 19 '11 at 10:16













    0














    I recently got a reply from the Telerik support that their AJAX grid supports client binding out-of-the-box with sorting, paging and filtering with flat structure only (as in this demo).



    For your case you may have two options:




    • extend the example with grid settings persister - http://demos.telerik.com/aspnet-ajax/grid/examples/programming/savinggridsettingsonperuserbasis/defaultcs.aspx

    • implement custom solution to simulate hierarchy with client binding as presented in this blog post.






    share|improve this answer




























      0














      I recently got a reply from the Telerik support that their AJAX grid supports client binding out-of-the-box with sorting, paging and filtering with flat structure only (as in this demo).



      For your case you may have two options:




      • extend the example with grid settings persister - http://demos.telerik.com/aspnet-ajax/grid/examples/programming/savinggridsettingsonperuserbasis/defaultcs.aspx

      • implement custom solution to simulate hierarchy with client binding as presented in this blog post.






      share|improve this answer


























        0












        0








        0







        I recently got a reply from the Telerik support that their AJAX grid supports client binding out-of-the-box with sorting, paging and filtering with flat structure only (as in this demo).



        For your case you may have two options:




        • extend the example with grid settings persister - http://demos.telerik.com/aspnet-ajax/grid/examples/programming/savinggridsettingsonperuserbasis/defaultcs.aspx

        • implement custom solution to simulate hierarchy with client binding as presented in this blog post.






        share|improve this answer













        I recently got a reply from the Telerik support that their AJAX grid supports client binding out-of-the-box with sorting, paging and filtering with flat structure only (as in this demo).



        For your case you may have two options:




        • extend the example with grid settings persister - http://demos.telerik.com/aspnet-ajax/grid/examples/programming/savinggridsettingsonperuserbasis/defaultcs.aspx

        • implement custom solution to simulate hierarchy with client binding as presented in this blog post.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered May 19 '11 at 13:57









        Dick LampardDick Lampard

        2,2181107




        2,2181107






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f6044259%2ftelerik-radgrid-persist-client-state-on-sort-paging-filter%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Wiesbaden

            Marschland

            Dieringhausen