Hi,
I use a VirtualCollection binded to a RadGridView (Version 2015.1.225.45 framework 4.5.1 )
My scenario is : when i click on the button move last VirtualCollectionPays.MoveCurrentToLast(); the scrollbar of gridview move to last position and when i click on the button move fist VirtualCollectionPays.MoveCurrentToFirst(); the scrollbar of gridview move to fist position .
Error : when i move to the last and come back to first position the loading event in virtual collection make a recursive call and load all Items in the database .
I use a plain wcf services not rest nether data services .
i use an async methode in the loading event .
//
when selected change of gridView the scrollbar change position
same problem when i change SelectionChanged with PropertyChanged
I use a VirtualCollection binded to a RadGridView (Version 2015.1.225.45 framework 4.5.1 )
My scenario is : when i click on the button move last VirtualCollectionPays.MoveCurrentToLast(); the scrollbar of gridview move to last position and when i click on the button move fist VirtualCollectionPays.MoveCurrentToFirst(); the scrollbar of gridview move to fist position .
Error : when i move to the last and come back to first position the loading event in virtual collection make a recursive call and load all Items in the database .
I use a plain wcf services not rest nether data services .
i use an async methode in the loading event .
//
public
async
void
LoadData()
{
VirtualCollectionPays =
new
VirtualQueryableCollectionViewExtended<Pay>() { LoadSize = SizePage };
VirtualCollectionPays.ItemsLoading += VirtualCollectionPays_ItemsLoading;
PayDataPage datapager =
null
;
var slowTask = Task.Run(() =>
{
datapager = _dataProvider.GetQueryableLazyPay(SizePage, position, PayFilterDescriptor, PaySortDescriptor, PayGroupDescriptor);
});
await slowTask;
VirtualCollectionPays.VirtualItemCount = datapager.TotalCount;
VirtualCollectionPays.Load(0, datapager.DataItems);
}
async
void
VirtualCollectionPays_ItemsLoading(
object
sender, VirtualQueryableCollectionViewItemsLoadingEventArgs e)
{
BusyIndicatorGrid =
true
;
try
{
PayDataPage datapager =
null
;
ItemsLoading = Task.Run(() =>
{
datapager = _dataProvider.GetQueryableLazyPay(SizePage, e.StartIndex, PayFilterDescriptor, PaySortDescriptor, PayGroupDescriptor);
});
await ItemsLoading;
VirtualCollectionPays.Load(e.StartIndex, datapager.DataItems);
BusyIndicatorGrid =
false
;
}
catch
(Exception ex)
{
string
mg = ex.Message;
}
}
when selected change of gridView the scrollbar change position
void
radGridViewPay_SelectionChanged(
object
sender, SelectionChangeEventArgs e)
{
var VMListePay =
this
.DataContext
as
VMListePay;
radGridViewPay.ScrollIndexIntoView(VMListePay.VirtualCollectionPays.CurrentPosition);
}
same problem when i change SelectionChanged with PropertyChanged
void
VirtualCollectionPays_PropertyChanged(
object
sender, System.ComponentModel.PropertyChangedEventArgs e)
{
var VMListePay =
this
.DataContext
as
VMListePay;
if
(e.PropertyName ==
"CurrentPosition"
)
{
if
(VMListePay.VirtualCollectionPays.CurrentPosition >= 0)
{
radGridViewPay.ScrollIndexIntoView(VMListePay.VirtualCollectionPays.CurrentPosition);
}
}
}