Hi,
I have an issue with the RadGridView when used with NHibernate and Lazy loading.
When the page initially loads the gridview appears empty, but if I scroll data appears; this is aldo tru for paging with the RadDataPager, the first page appears empty but if you move to the second page then back, the data can be seen.
I am using the MVVM pattern and exposing an instance of VirtualQueryCollectionView to the view; if I put a break point on the property, I can see it being hit when the grid binds to the ViewModel. Looking inside the instance of the VirtualQueryCollection, I can see my data in the QueryableSourceCollection property, but the results view shows an IEnumerable filled with nulls.
A simplified view of my code would be something like:
View
ViewModel
Repository
Any advice would be more than welcome, however I am stuck with NHibernate and must use lazy loading because of the amount of data.
Thanks In advance.
Paul.
I have an issue with the RadGridView when used with NHibernate and Lazy loading.
When the page initially loads the gridview appears empty, but if I scroll data appears; this is aldo tru for paging with the RadDataPager, the first page appears empty but if you move to the second page then back, the data can be seen.
I am using the MVVM pattern and exposing an instance of VirtualQueryCollectionView to the view; if I put a break point on the property, I can see it being hit when the grid binds to the ViewModel. Looking inside the instance of the VirtualQueryCollection, I can see my data in the QueryableSourceCollection property, but the results view shows an IEnumerable filled with nulls.
A simplified view of my code would be something like:
View
<telerik:RadGridView x:Name="Grid" ItemsSource="{Binding MyDataCollection}">ViewModel
protected MyViewModel(MyDataRepository repository){ Repository = repository; GetMyData()}public VirtualQueryableCollectionView MyDataCollection { get; set; }private void GetMyData(){ MyDataCollection= new VirtualQueryableCollectionView(Repository.GetMyData() {LoadSize = 50, VirtualItemCount = 4000})}Repository
public IQueryable<MyData> GetMyData (){ var session = Session.SessionFactory.OpenSession() return session.Query<MyData>() .Where(a => Property1.Contains(a.Value));}Any advice would be more than welcome, however I am stuck with NHibernate and must use lazy loading because of the amount of data.
Thanks In advance.
Paul.