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.
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.