Setting VirtualQueryableCollectionView VirtualItemCount clears collection

5 posts, 0 answers
  1. Konstantin
    Konstantin avatar
    16 posts
    Member since:
    Oct 2010

    Posted 11 Feb 2011 Link to this post

    Hi, I use VirtualQueryableCollectionViewwith following code (copied from here
    view.ItemsLoading += (s, e) =>
    context.Load<Order_Detail>(query.Skip(e.StartIndex).Take(e.ItemCount)).Completed += (sender, args) =>
    var lo = (LoadOperation)sender;
    if (lo.TotalEntityCount != -1 && lo.TotalEntityCount != view.VirtualItemCount)
    view.VirtualItemCount = lo.TotalEntityCount;
    view.Load(e.StartIndex, lo.Entities);

    If TotalEntityCount was changed (new items were added on Server), VirtualItemCount is setted to new value. But setter of VirtualItemCount  clears internal collection and fills it by null values. As a result view will contains empty placaholders for old records.
  2. Vlad
    Vlad avatar
    11100 posts

    Posted 11 Feb 2011 Link to this post


     Indeed this is by design - every time you change the VirtualItemCount you will be forced to re-download the data.

    the Telerik team
    Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
  3. DevCraft banner
  4. ss
    ss avatar
    50 posts
    Member since:
    Jun 2010

    Posted 07 Mar 2011 Link to this post

    I dont like this behaviour. Dou you know some way how can I keep old items? 
  5. Charlie
    Charlie avatar
    24 posts
    Member since:
    Jan 2009

    Posted 06 May 2011 Link to this post

    I dont like that design either.  Is there a workaround to this design?  Can QueryableDomainServiceCollectionView and VirtualQueryableCollectionView be used interchangeable?


    Charlie J.
  6. Christina
    Christina avatar
    6 posts
    Member since:
    Jul 2012

    Posted 17 Jul 2013 Link to this post

    Has this changed in the last two years? Or is there still no way to not re-download data when changing VirtualItemCount?
Back to Top
DevCraft banner