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

Problem with paging and QueryableCollectionView

5 Answers 206 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Edvin
Top achievements
Rank 1
Edvin asked on 14 May 2010, 09:50 AM

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

Sort by
0
Yavor Georgiev
Telerik team
answered on 14 May 2010, 01:14 PM
Hi Edvin,

 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.
0
Edvin
Top achievements
Rank 1
answered on 14 May 2010, 02:29 PM
Hi,
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
0
Yavor Georgiev
Telerik team
answered on 14 May 2010, 03:55 PM
Hello 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.

All the best,
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.
0
Jonathan
Top achievements
Rank 1
answered on 14 Mar 2012, 02:11 AM
When I call AddNew on a VirtualQueryableCollectionView it does not show up in the GridView.

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?
0
Vlad
Telerik team
answered on 14 Mar 2012, 07:43 AM
Hi,

 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
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
GridView
Asked by
Edvin
Top achievements
Rank 1
Answers by
Yavor Georgiev
Telerik team
Edvin
Top achievements
Rank 1
Jonathan
Top achievements
Rank 1
Vlad
Telerik team
Share this question
or