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

Setting VirtualQueryableCollectionView VirtualItemCount clears collection

4 Answers 148 Views
Data Virtualization
This is a migrated thread and some comments may be shown as answers.
Konstantin
Top achievements
Rank 1
Konstantin asked on 11 Feb 2011, 01:42 PM
Hi, I use VirtualQueryableCollectionViewwith following code (copied from here http://www.telerik.com/help/silverlight/using-data-virtualization.html):
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.

4 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 11 Feb 2011, 01:54 PM
Hi,

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

Regards,
Vlad
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
ss
Top achievements
Rank 1
answered on 07 Mar 2011, 02:23 PM
I dont like this behaviour. Dou you know some way how can I keep old items? 
0
Charlie
Top achievements
Rank 2
answered on 06 May 2011, 06:52 PM
I dont like that design either.  Is there a workaround to this design?  Can QueryableDomainServiceCollectionView and VirtualQueryableCollectionView be used interchangeable?

Thanks,

Charlie J.
0
Christina
Top achievements
Rank 1
answered on 17 Jul 2013, 04:23 PM
Has this changed in the last two years? Or is there still no way to not re-download data when changing VirtualItemCount?
Tags
Data Virtualization
Asked by
Konstantin
Top achievements
Rank 1
Answers by
Vlad
Telerik team
ss
Top achievements
Rank 1
Charlie
Top achievements
Rank 2
Christina
Top achievements
Rank 1
Share this question
or