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

VirtualQueryableCollectionView() vs VirtualQueryableCollectionView<T>()

3 Answers 136 Views
Data Virtualization
This is a migrated thread and some comments may be shown as answers.
Mike
Top achievements
Rank 1
Mike asked on 28 Apr 2015, 03:04 PM

I would like to know the difference between these two types, besides the obvious that one is a generic and the other is not.

Specifically:

1. Why does the generic version not support the same constructors passing an IEnumerable query?

2. Does the non generic version when passed a IEnumerable query inherently know the collection type by the result type of the query?

3. What then is the purpose of the VirtualQueryableCollectionView(IEnumerable, Type) constructor, as the second parameter Type will need to match that of the IEnumerable?

4. Is there a way within the ItemsLoading to force the non generic version to let user code handle the query (ie. e.Handled = true)

The non generic version blocks on the UI thread when requesting new items.  This is very odd coming from Telerik.  .  Even if you don't pass a query on the constructor, the ItemsLoading still blocks while loading nothing.

This blocking UI is very bad, forcing me to use the generic version which allows me to handle the ItemsLoading query (queuing the request on a background thread as is correct).

Thanks,

Mike

 

 

 

 

3 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 01 May 2015, 11:02 AM
Hi Mike,

As it turns out VirtualQueryableCollectionView<T>() just sets element type based on <T>. This is its source code:
public class VirtualQueryableCollectionView<T> : VirtualQueryableCollectionView
{
    /// <summary>
    /// Initializes a new instance of the VirtualQueryableCollectionView class.
    /// </summary>
    public VirtualQueryableCollectionView()
    {
        this.SetElementType(typeof(T));
    }
}

As a side note, the full source code of UI for WPF is also available for download from your account:
Telerik_UI_for_WPF_Source_2015_1_0401.zip

All the source code of VirtualQueryableCollectionView() and VirtualQueryableCollectionView<T>() is located in ..\\Core\Data\Collections.VirtualQueryableCollectionView.cs, VirtualQueryableCollectionViewItemsLoadedEventArgs.cs and VirtualQueryableCollectionViewItemsLoadingEventArgs.cs.

You can download it and directly debug the exact usage referencing the source projects in order to undestand in details and get the best experience working with the virtual collection.

As to all your specific questions, actually VirtualQueryableCollectionView was introduced a long time ago - back in year 2010 and therefore I may not be very specific on the exact reasons for choosing this design exactly. 

You can also check the online documentation on Data Virtualization
.


Regards,
Dimitrina
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
0
Mike
Top achievements
Rank 1
answered on 04 May 2015, 06:51 PM

This is excellent, I didn't realize I had access to the source!

So the next obvious question is, to what extent am I allowed to modify and possibly build my own version of VirtualQueryableCollectionView?

 Thanks,

Mike

0
Dimitrina
Telerik team
answered on 05 May 2015, 11:48 AM
Hello Mike,

You can either build your own collection to better serve the exact purpose you have or extend our source code. Please note we do not officially provide support services for custom implementations done over the code we provide.

As to building the source code, you can refer to the documentation on: Building Telerik Assemblies from Source Code.

Regards,
Dimitrina
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
Tags
Data Virtualization
Asked by
Mike
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Mike
Top achievements
Rank 1
Share this question
or