Hi,
I am currently using 2010 Q3 beta especially to try the new VirtualQueryableCollectionView class.
I implemented a sample project based on the code from your demo (First Look). The only difference is that I am not using a DataContext and keeping data in memory, I am calling a web service to get the data each time.
The control is working quite nicely but I am having 2 issues right now.
A) The collection seems good for a paged grid, but I am using virtual scrolling. What happens is that when I scroll down to data that is not loaded yet, the Collection loads the missing data but the data that were there before disappears (see here).
B) When I scroll back up to the very first row, the ItemsLoading event is not fired, thus the grid remains blank (because of issue A).
Those issues do not happen in your demo, and they did not happen to me when I bound the grid to in-memory data. Getting the data through a web service is what causes it. Please find attached relevant code that may explains what I possibly did wrong.
I assume B is fixed when A is fixed, so my question will mostly be: how to fix A? ;)
Thanks
ps: the GetData method of the web service returns a 3rd party DataSet for Silverlight ; the .GetBindableData returns an IEnumerable. Wo do that because our data is all dynamic so it's just easier and as efficient as creating dynamic objects.
I am currently using 2010 Q3 beta especially to try the new VirtualQueryableCollectionView class.
I implemented a sample project based on the code from your demo (First Look). The only difference is that I am not using a DataContext and keeping data in memory, I am calling a web service to get the data each time.
The control is working quite nicely but I am having 2 issues right now.
A) The collection seems good for a paged grid, but I am using virtual scrolling. What happens is that when I scroll down to data that is not loaded yet, the Collection loads the missing data but the data that were there before disappears (see here).
B) When I scroll back up to the very first row, the ItemsLoading event is not fired, thus the grid remains blank (because of issue A).
Those issues do not happen in your demo, and they did not happen to me when I bound the grid to in-memory data. Getting the data through a web service is what causes it. Please find attached relevant code that may explains what I possibly did wrong.
I assume B is fixed when A is fixed, so my question will mostly be: how to fix A? ;)
Thanks
Private
_Data
As
VirtualQueryableCollectionView
Public
Property
Data()
As
VirtualQueryableCollectionView
Get
If
_Data
Is
Nothing
Then
_Data =
New
VirtualQueryableCollectionView
_Data.VirtualItemCount = 999999
_Data.LoadSize = 100
AddHandler
_Data.ItemsLoading,
AddressOf
ItemsLoading
End
If
Return
_Data
End
Get
Private
Set
(
ByVal
value
As
VirtualQueryableCollectionView)
If
Me
._Data IsNot value
Then
RemoveHandler
_Data.ItemsLoading,
AddressOf
ItemsLoading
Me
._Data = value
End
If
End
Set
End
Property
Private
Sub
ItemsLoading(
ByVal
sender
As
Object
,
ByVal
e
As
VirtualQueryableCollectionViewItemsLoadingEventArgs)
Dim
tServClient
As
New
ElementViewService.svc_ElementViewServiceClient
AddHandler
tServClient.GetDataCompleted,
AddressOf
ItemsLoaded
tServClient.GetDataAsync(
Nothing
,
Nothing
,
Nothing
, e.StartIndex, 100, e.StartIndex)
End
Sub
Private
Sub
ItemsLoaded(
ByVal
sender
As
Object
,
ByVal
e
As
ElementViewService.GetDataCompletedEventArgs)
Dim
tDS
As
New
DataSet
tDS.FromXml(e.Result)
Data.Load(e.UserState, tDS.Tables(0).GetBindableData(
New
Connector))
End
Sub
Public
Sub
New
()
InitializeComponent()
grid.ItemsSource = Data
End
Sub
ps: the GetData method of the web service returns a 3rd party DataSet for Silverlight ; the .GetBindableData returns an IEnumerable. Wo do that because our data is all dynamic so it's just easier and as efficient as creating dynamic objects.