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

2010 Q1 SL4 Grid doesn't retain selected items on cached pages

7 Answers 71 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Eric Lincoln
Top achievements
Rank 1
Eric Lincoln asked on 25 Mar 2010, 04:16 PM

I'm using the 2010 Q1 RadGridView (2010.1.319.1040) w/VS2010 RC, Silverlight4, RiA Services/EF and MS DataPager.
If the user selects one or more items on a page, pages to a new page and then back to the original page the selected items are no longer there.


Thanks,
Eric

7 Answers, 1 is accepted

Sort by
0
Milan
Telerik team
answered on 31 Mar 2010, 08:10 AM
Hi Eric Lincoln,

Currently that is expected behavior since the items on the next page are different item and they were never selected. Still, we will consider adding better support for such scenarios. For now, you could you try this possible workaround.

Hope it helps.


Best wishes,
Milan
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
Eric Lincoln
Top achievements
Rank 1
answered on 31 Mar 2010, 09:24 PM

Milan,
I'm afraid that my description of the problem wasn't clear. Here's the scenario:
1. user on page 1 selects rows 1 and 2.
2. user pages to page 2.
3. user returns to page 1 however, rows 1 and 2 are no longer selected (i.e. the rows still exist with the same content but they're no longer highlighted).

In my original post I said that when the user returned to the original page the selected items were no longer there. I should've said that the rows that were selected were no longer highlighted.

Also I should mention that this problem didn't exist with the 2009 3 1313 1040 grid. Selected rows would remain selected regardless of whether their page was in view or not. 

Sorry for the confusion.
Eric

0
Eric Lincoln
Top achievements
Rank 1
answered on 02 Apr 2010, 06:22 PM

Milan,
I solved the problem described in my previous post by loading the grid using the DomainContext vs the DomainDataSource. I then instantiated a PagedCollectionView with the resulting LoadOperation.Entities and bound this PagedCollectionView to the grid. My idea was to track selected items by setting a 'selected' flag in the PagedCollectionView and use this to reset the highlighted row whenever a new page appeared.. However this proved uneccessary because when I set the grid's DataLoadMode=Asynchronous the ability of the grid to track selected items across pages magically reappeared.!  Please note that If the DataLoadMode is not set or set to Synchronous then this ability disappears.

Now my only complaint is whenever I change pages the 'IsBusy' screen flashes on and off. I set IsBusy=False but it doesn't make any difference. Is there any way to remove this annoyance other than to set DataLoadMode to 'Synchronous'?

Thanks,
Eric

0
Milan
Telerik team
answered on 06 Apr 2010, 03:13 PM
Hi Eric Lincoln,

You can hide the loading indicator by modifying the RadGridView template or simply finding the indicator in the visual tree and making it invisible:

01.void myGrid_Loaded(object sender, System.Windows.RoutedEventArgs e)
02.{
03.    this.Dispatcher.BeginInvoke(new System.Action(() => this.DisableIndicator()));
04.}
05.  
06.private void DisableIndicator()
07.{
08.    var indicator = this.myGrid.ChildrenOfType<GridViewLoadingIndicator>().FirstOrDefault();
09.  
10.    indicator.Opacity = 0;
11.}

We will also try to provide better support for selection scenarios like yours in a future release.

Thank you for your feedback one again.

Best wishes,
Milan
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
Eric Lincoln
Top achievements
Rank 1
answered on 06 Apr 2010, 05:28 PM
Milan,
The code supplied in your last post failed to prevent the 'Loading' screen (dark gray background with single yellow circle in center) from flashing on and off. Instead it seems to prevent data from loading. That is, the 'Data Loading' screen still flashes on and off but afterwards the grid never gets populated with data.

I notice that in the Telerik RIA Domain Data Source demo's xaml a binding is specified for 'IsBusy'. I would assume that if no binding is supplied or IsBusy='False' then no 'Loading' indicatior should appear. However this is not the case.

Believe it or not the selection scenario issues that I described were less important than other issues that I uncovered when using the Telerik grid and RIA's Domain Data Source: for example, if a user edits the contents of a cell or deletes rows using the delete key the pager is disabled.

Eric
0
Accepted
Milan
Telerik team
answered on 12 Apr 2010, 04:04 PM
Hi Eric Lincoln,

After some investigation it turned out that the issue is caused by a limitation in DomainDataSource itself - one you commit an edit the CanChangePage property stays false forever. If you try using Microsoft's DataGrid or/and DataPager you will observe the same behavior. To continue paging you should first commit all changes to the database by calling SubmitChanged of the DomainDataSource. Some more information can be found here.

In regard to the IsBusy property, you are absolutely correct - the loading indicator should not appear unless the IsBusy is manually set to true (for example through binding) or asynchronous data load mode is used.

I would like to ask you to share any other issue that are stopping your work so that we can try to fix them as soon as possible.

Regards,
Milan
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
Eric Lincoln
Top achievements
Rank 1
answered on 12 Apr 2010, 04:32 PM
Milan,
You are absolutely correct the disabling of the DataPager when deleting or editing a row is a DomainDataSource problem. I should've made that  clear when I alluded to it. Thanks for the wok around. It'll be interesting if today's VS2010 release fixes it.

I'll add the IsBusy issue to the PITS.

Thanks for all your help,
Eric
Tags
GridView
Asked by
Eric Lincoln
Top achievements
Rank 1
Answers by
Milan
Telerik team
Eric Lincoln
Top achievements
Rank 1
Share this question
or