VirtualQueryableCollectionView() vs VirtualQueryableCollectionView<T>()

4 posts, 0 answers
  1. Mike
    Mike avatar
    6 posts
    Member since:
    Aug 2014

    Posted 28 Apr 2015 Link to this post

    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

     

     

     

     

  2. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 01 May 2015 Link to this post

    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.

     
  3. UI for WPF is Visual Studio 2017 Ready
  4. Mike
    Mike avatar
    6 posts
    Member since:
    Aug 2014

    Posted 04 May 2015 in reply to Dimitrina Link to this post

    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

  5. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 05 May 2015 Link to this post

    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.

     
Back to Top