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

Cahce/store/save state of master-detail grid

4 Answers 41 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Pawel
Top achievements
Rank 1
Pawel asked on 27 Jul 2010, 08:28 PM
Hi.
I have a scenario similar to your demo "master-detail grids" (http://demos.telerik.com/aspnet-ajax/grid/examples/programming/selectedvalue/defaultcs.aspx). After appropriate selections I go to other page, then do something there and return to "master-detail grids" page. Normally everything on "master-detail grids" page returns to initial state after every entry, but I would like to store all states of grids (e.g. If I selected second row in first grid and other grids displayed some positions, I would like them to keep these values when I return the page). Is it possible to do it? I have also combo boxes on this page, also dependent on grid. Is it possible to store all states, to avoid additional selections on each page entry?
Greetings:
Pawel

4 Answers, 1 is accepted

Sort by
0
Pawel
Top achievements
Rank 1
answered on 29 Jul 2010, 07:50 PM
Hi.
Have you found any solution/approach, that I can apply to store a state of controls, as described?
Greetings:
Pawel
0
Radoslav
Telerik team
answered on 02 Aug 2010, 09:02 AM
Hello Pawel,

To achieve the desired functionality you could check out the following code library which demonstrates how to saving grid settings on a per user basis:
http://www.telerik.com/help/aspnet-ajax/grdsavingsettingsonperuserbasis.html

Additionally to save the selected items from the comboboxes you could try using the Dictionary save into the Session which holds all comboboxes IDs with related selected indexes and on page_load to restore combos' selection.

Please give it try and let me know if you experience any problems.

Kind regards,
Radoslav
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
0
Pawel
Top achievements
Rank 1
answered on 04 Aug 2010, 11:20 AM
Hi.
Sorry, but the first part of your answer does not solve the problem with grids.
I have such solution applied, but it stores only a Grids "Metadata" as is also described in the article, that you recommended (quote ->):

For your convenience, the functionality is isolated in a single class called GridSettingsPersister. It is designed to save from and load into Telerik RadGrid the following runtime settings:
  • Page size
  • Group-by expressions
  • Sort expressions
  • Filter expression
  • Column settings
    • Width
    • OrderIndex
    • Display
    • Visible
    • CurrentFilterFunction
    • CurrentFilterValue

My problem concerning grids touches presented data. I want to select one row in first grid. This determines subset of rows in other grids (as in master detail scenario). Then I need to store this states of grids (not ordering, filtering, columns, etc., but strictly a data selection or presented subsets), just to have the same selection of row on first grids, and the same subsets of rows on other grids.
I don't want to re-select rows on first grid each time I return page - I just want selection and other presented rows to be stored.

As I am not able to put a part of my application here, as it depends on many external components, I will describe you what I expect to gain, basing on your master-detail grid scenario (http://demos.telerik.com/aspnet-ajax/grid/examples/programming/selectedvalue/defaultcs.aspx):
1. selection of sample row in first grid (e.g. for customerId: AROUT)
2. some rows (dependent on AROUT selection) in second grid are depicted
3. I select one row in second grid (e.g. for OrderId: 10383)
4. some rows (dependent on 10383) in third grid are depicted (3 rows)
5. now lets go to other page (and return) or refresh current one - as we can see, all grids' data is refreshed to initial state (customerId: AROUT is not selected on first grid, in second grid there is a different subset than for AROUT, in second grid OrderId: 10383 is not selected and a set of rows for 10383 does not fit those for 10383 in third grid). So nothing was stored in context of grids content

Summary:
My intention is to store mentioned selections and rows sets for all grids on page after refresh or returning from other pages.

Proposed article does not solve this problem, so there is another solution needed.
Greetings:
Pawel
0
Radoslav
Telerik team
answered on 09 Aug 2010, 07:29 AM
Hi Pawel,

By default the RadGrid does not persists its selected rows after post back. In order to achieve the desired functionality you need to store the information for the selected rows into client side or server side collection variable. For more information please check out the following online resources:
http://www.telerik.com/help/aspnet-ajax/grid-persist-selected-rows-client-sorting-paging-grouping-filtering.html
http://www.telerik.com/help/aspnet-ajax/grdpersistselectedrowsonsorting.html
http://www.telerik.com/help/aspnet-ajax/grdselectedrowatalltimes.html
http://www.telerik.com/community/code-library/aspnet-ajax/grid/client-side-row-selection-persisted-with-paging.aspx

All the best,
Radoslav
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
Tags
Grid
Asked by
Pawel
Top achievements
Rank 1
Answers by
Pawel
Top achievements
Rank 1
Radoslav
Telerik team
Share this question
or