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

Trigger loading by hand

3 Answers 88 Views
Data Virtualization
This is a migrated thread and some comments may be shown as answers.
Pawel
Top achievements
Rank 1
Pawel asked on 02 Jul 2015, 09:38 AM

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);

3 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 06 Jul 2015, 12:40 PM
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
0
Pawel
Top achievements
Rank 1
answered on 14 Jul 2015, 02:20 PM

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)

0
Dimitrina
Telerik team
answered on 16 Jul 2015, 11:58 AM
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
Tags
Data Virtualization
Asked by
Pawel
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Pawel
Top achievements
Rank 1
Share this question
or