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