This is a migrated thread and some comments may be shown as answers.
Data Virtualization ItemsLoading Event not Calling
1 Answer 7 Views
This is a migrated thread and some comments may be shown as answers.
victor
Top achievements
Rank 1
victor asked on 30 Nov 2015, 02:34 PM

Hi Team

The Data Virtualization  view.ItemsLoading += (s, args) =>  event not calling  is there anything more to do with this . my code is below please help me on this.

C# code:-

VirtualView = new VirtualQueryableCollectionView() { LoadSize = 500, VirtualItemCount = 200 };
VirtualView.ItemsLoading += (s, e) =>
{
var querytoLoad = dcBusinessAccountingContext.GetDepositListingSPQuery(search, searchDate, status).OrderByDescending(o => o.TransactionDate).IncludeTotalCount(true).Sort(VirtualView.SortDescriptors).Where(VirtualView.FilterDescriptors).Skip(e.StartIndex).Take(e.ItemCount);
dcBusinessAccountingContext.Load<DepositsListingSP_Result>(querytoLoad, LoadBehavior.MergeIntoCurrent, false).Completed += (senders, args) =>
{
var lo = (LoadOperation)senders;
if (lo.TotalEntityCount != -1 && lo.TotalEntityCount != VirtualView.VirtualItemCount)
{
VirtualView.VirtualItemCount = lo.TotalEntityCount;
}
else
{

}
VirtualView.Load(e.StartIndex, lo.Entities);
newdepositListing.BusyIndicator.IsBusy = false;
SetGridLinesVisibility.SetGridLines(newdepositListing.dtgdepositList);
GridViewScrollViewer scrollViewer = newdepositListing.dtgdepositList.ChildrenOfType<GridViewScrollViewer>().FirstOrDefault();
objApplicationClass.AdjustFooterHeight(newdepositListing.dtgdepositList, false);
if (scrollViewer != null)
{
if (scrollViewer.ComputedVerticalScrollBarVisibility == System.Windows.Visibility.Visible)
{
objApplicationClass.AdjustFooterHeight(newdepositListing.dtgdepositList, false);
}
else
{
objApplicationClass.AdjustFooterHeight(newdepositListing.dtgdepositList, true);
}
}
};
};
newdepositListing.DataContext = VirtualView;

Xaml Code:-

<telerikpresentation:RadGridView x:Name="dtgdepositList" Margin="0" RowHeight="22" Grid.Row="1" Height="Auto"
BorderThickness="0,1,0,0" IsReadOnly="True"
AutoGenerateColumns="true" VerticalAlignment="Top"
HorizontalAlignment="Stretch" IsFilteringAllowed="False"
ShowColumnHeaders="True" ShowGroupPanel="False" ItemsSource="{Binding}"
CanUserSelect="True" CanUserSortColumns="True" telerikpresentation:PersistenceManager.StorageId="dtgdepositList" CanUserFreezeColumns="False" IsEnabled="True" IsSynchronizedWithCurrentItem="False"
CanUserResizeColumns="True" RowIndicatorVisibility="Collapsed"
Cursor="Hand" MinWidth="850"
GridViewHeaderMenu:ContextMenuBehaviour.IsEnabled="True" ShowColumnFooters="False"
SelectedItem="{Binding Path=SelectedDepositListing, Mode=TwoWay}"
ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Auto" IsLocalizationLanguageRespected="False" >
<i:Interaction.Behaviors>
<EmptyDataTemplate:EmptyDataTemplateBehavior>
<EmptyDataTemplate:EmptyDataTemplateBehavior.EmptyDataTemplate>
<DataTemplate>
<TextBlock Text="No results found!" Foreground="Red" HorizontalAlignment="Center" VerticalAlignment="Center" Visibility="{Binding MessageVisibility}" />
</DataTemplate>
</EmptyDataTemplate:EmptyDataTemplateBehavior.EmptyDataTemplate>
</EmptyDataTemplate:EmptyDataTemplateBehavior>
</i:Interaction.Behaviors>
</telerikpresentation:RadGridView>

 

1 Answer, 1 is accepted

Sort by
0
Yoan
Telerik team
answered on 03 Dec 2015, 02:13 PM
Hi Victor,

Unfortunately with the supplied information I cannot figure out what is going on. Could you please try to isolate the problem you have in the sample project from my previous reply? Then you can send it to me for further investigation.

As a side note - you can check our online demo which demonstrates how to use RadGridView with VQCV.


Regards,
Yoan
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
Asked by
victor
Top achievements
Rank 1
Answers by
Yoan
Telerik team
Share this question
or