Problem with paging and QueryableCollectionView

6 posts, 0 answers
  1. Edvin
    Edvin avatar
    16 posts
    Member since:
    Aug 2007

    Posted 14 May 2010 Link to this post

    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

  2. Yavor Georgiev
    Admin
    Yavor Georgiev avatar
    982 posts

    Posted 14 May 2010 Link to this post

    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.
  3. Edvin
    Edvin avatar
    16 posts
    Member since:
    Aug 2007

    Posted 14 May 2010 Link to this post

    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
  4. Yavor Georgiev
    Admin
    Yavor Georgiev avatar
    982 posts

    Posted 14 May 2010 Link to this post

    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.
  5. Jonathan
    Jonathan avatar
    37 posts
    Member since:
    Jul 2012

    Posted 13 Mar 2012 Link to this post

    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?
  6. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 14 Mar 2012 Link to this post

    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 >>
Back to Top