Hi,
I found that GridView does not work correctly with paging and QueryableCollectionView.
I have a GridView and pager:
ObservableCollection<User> m_collUsers = new ObservableCollection<User>();
//PagedCollectionView qcv = new PagedCollectionView(m_collUsers);
QueryableCollectionView qcv = new QueryableCollectionView(m_collUsers);
gvUsers.ItemsSource = qcv;
pagerUsers.Source = qcv;
now if I add or remove objects to m_collUsers GridView is not updated. Without paging or with PagedCollectionView works ok.
Thanks
edvin
5 Answers, 1 is accepted
Please find attached a sample solution that illustrates a working example with RadDataPager and RadGridView bound to a QueryableCollectionView created from an ObservableCollection. If this does not help, please share more details about your scenario.
Regards,Yavor Georgiev
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.
thanks for your response.
To see the problem just replace the line (in your sample):
this.Persons.Add(new Person { FirstName = this.firstNameBox.Text, LastName = this.lastNameBox.Text });
with:
this.Persons.RemoveAt(0);
br
edvin
We have identified this issue as a potential bug and we have entered it in our PITS system. You can track its progress at the following address: http://www.telerik.com/support/pits.aspx#/public/silverlight/2158
The workaround is to bind your RadPager to your QueryableCollectionView, and then bind the RadGridView\s ItemsSource to the RadPager''s PagedSource property. You then have to call RadGridView.Rebind() when removing items from your underlying collection does not refresh the grid properly. You will not incur significant performance penalty, because the RadPager sits between the grid and your data source.
I have awarded you Telerik points.
Yavor Georgiev
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.
I tried to download the attached file of http://www.telerik.com/support/pits.aspx#/public/silverlight/2158 but it will not let me. Can you please publish that code?
Generally VirtualQueryableCollectionView is designed to work mostly in read-only scenarios. You can add and remove items in your source collection and reload the virtual collection when needed.
All the best,Vlad
the Telerik team