This question is locked. New answers and comments are not allowed.
Hi, I'm relatively new to the Telerik Components, but so far they've been great, and very useful.
We're currently using a GridView and a pager to query a DomainDataSource and show it on screen, using paging.
We then have the following code in App.xaml
So far this works great. We also noticed that it gets data asynchronously.
However, we wish to try getting data from the datacontext and applying it to both the pager and the gridview entirely via code.
So far, we have the following:
This works well for small queries, such as getting the top 100 records, but we can no longer fetch the entire table asynchronously. Is there a way to do this in code?
Thanks.
We're currently using a GridView and a pager to query a DomainDataSource and show it on screen, using paging.
<telerik:RadGridView x:Name="ResultsGrid" Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="3" Grid.RowSpan="1" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" AutoGenerateColumns="True" ScrollMode="Deferred" ItemsSource="{Binding Source={StaticResource ExampleDomainService},Path=Data}" telerik:StyleManager.Theme="Windows7" AutoExpandGroups="True" > </telerik:RadGridView> <telerik:RadDataPager Grid.Row="4" Height="28" HorizontalAlignment="Left" Margin="10,10,0,0" Name="radDataPager1" VerticalAlignment="Top" Source="{Binding Source={StaticResource ExampleDomainService},Path=Data}" telerik:StyleManager.Theme="Windows7"/>We then have the following code in App.xaml
<ria:DomainDataSource x:Key="ExampleDomainService" QueryName="GetISCOMPETITIONRESULTTABLEs" AutoLoad="True" PageSize="10" > <ria:DomainDataSource.DomainContext> <services:ExampleDomainContext/> </ria:DomainDataSource.DomainContext></ria:DomainDataSource>So far this works great. We also noticed that it gets data asynchronously.
However, we wish to try getting data from the datacontext and applying it to both the pager and the gridview entirely via code.
So far, we have the following:
ctx = new ExampleDomainContext(); LoadOperation<Example> loadOp = ctx.Load(ctx.TakeTopNQuery(100));PagedCollectionView view = new PagedCollectionView(loadOp.Entities);view.PageSize = 10;ResultsPager.Source = view;ResultsPager.IsTotalItemCountFixed = true;ResultsGrid.ItemsSource = ResultsPager.PagedSource;This works well for small queries, such as getting the top 100 records, but we can no longer fetch the entire table asynchronously. Is there a way to do this in code?
Thanks.