Trigger loading by hand

4 posts, 0 answers
  1. Pawel
    Pawel avatar
    39 posts
    Member since:
    Apr 2014

    Posted 02 Jul 2015 Link to this post

    Hello

    Can I load some portion of data programmatically? For example:

    class Work { public string WorkTitle { get; set; } }
     
    var query = generateQueryFor<Work>.OrderBy(w => w.WorkTitle);
    var virtualQuery = new VirtualQueryableCollectionView(query) { LoadSize = 50 };
     
    virtualQuery.ItemsLoading += (sender1, eventArgs1) =>
    {
         //event doesn't firing
    };
    virtualQuery.ItemsLoaded += (sender2, eventArgs2) =>
    {
         //event doesn't firing
    };
     
    // how force to load some data?
    // GetItemAt doesn't loads any data
    var row0 = virtualQuery.GetItemAt(0);
    var row1 = virtualQuery.GetItemAt(1);
    var row2 = virtualQuery.GetItemAt(2);

  2. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 06 Jul 2015 Link to this post

    Hello,

    Would you please try invoking ResetItems(int startIndex, int count) for the virtual collection?

    Regards,
    Dimitrina
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for WPF is Visual Studio 2017 Ready
  4. Pawel
    Pawel avatar
    39 posts
    Member since:
    Apr 2014

    Posted 14 Jul 2015 Link to this post

    ResetItems cause System.ArgumentOutOfRangeException with message "Index was out of range. Must be non-negative and less than the size of the collection.​".

     Stacktrace:

                w System.ThrowHelper.ThrowArgumentOutOfRangeException()
                w System.Collections.ObjectModel.Collection`1.set_Item(Int32 index, T value)
                w System.Collections.ObjectModel.Collection`1.System.Collections.IList.set_Item(Int32 index, Object value)
                w Telerik.Windows.Data.VirtualQueryableCollectionView.ResetItems(Int32 startIndex, Int32 count)

  5. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 16 Jul 2015 Link to this post

    Hi,

    Have you set the virtual collection as a Source collection of an items control (for example RadGridView)? In case not, then you should do so. I am afraid it will not be possible to trigger loading otherwise. 

    Regards,
    Dimitrina
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top