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

Do I have to implement IQueryable in order to use VirtualQueryableCollectionView effectively?

1 Answer 222 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Joshua
Top achievements
Rank 1
Joshua asked on 09 Apr 2018, 11:10 PM

Hi, I have a very large collection that would not fit into local memory very well, and I was trying to make use of the VirtualQueryableCollectionView telerik class.  It takes an IEnumerable, but if I pass in an IEnumerable it loops through all items in order to get the initial Count().  I looked at https://www.telerik.com/blogs/data-virtualization-for-your-silverlight-and-wpf-applications and downloaded the example application, but under the hood it's using something called an .edmx which I'm not familiar with.

What I want to do is to fetch the data on-the-fly.  I tried implementing an IList and passing it to VirtualQueryableCollectionView but that didn't seem to work either.  I'm familiar with how WPF Datagrids handle virtualization and paging, (https://www.codeproject.com/Articles/34405/WPF-Data-Virtualization) and have used that before, but I'm not sure how to do it with a Telerik RadGridView.  Can you point me in the right direction?  I'd use the paging control except I want the user to be able to just scroll down.

1 Answer, 1 is accepted

Sort by
0
Yoan
Telerik team
answered on 12 Apr 2018, 03:11 PM
Hi Joshua,

The .edmx file is part of the EntityFramework with which the mentioned demo is built. However, this is the important part of it:
var query = context.Order_Details.OrderBy(o => o.OrderID);
 
           var view = new VirtualQueryableCollectionView(query) { LoadSize = 10 };

the "query" is IQueryable and it is pass to the VQCV. So, you can just create your IQueryable and pass it as a source of the VQCV and this should be sufficient for populating the GridView. I must mention that using IQueryable is recommended if you will perform Filtering operations as stated in the Using Data Virtualization help article.

Please give this a try and let us know if you need further assistance.

Regards,
Yoan
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
GridView
Asked by
Joshua
Top achievements
Rank 1
Answers by
Yoan
Telerik team
Share this question
or