This is a migrated thread and some comments may be shown as answers.

Pagesize and raddomaindatasource

10 Answers 128 Views
DataPager
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
David Ocasio
Top achievements
Rank 2
Iron
Veteran
Iron
David Ocasio asked on 16 Jun 2012, 12:06 PM
i have changed the template of the raddatapger to include a textbox that is bound to the pagesize property of its relative source like so

<ControlTemplate x:Key="DataPagerPresenterTemplate" TargetType="Telerik_Windows_Controls_Data_DataPager:DataPagerPresenter">
    <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
        <Grid HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <StackPanel Grid.Column="0" Margin="5,0" Orientation="Horizontal" Visibility="{Binding PagerControlsVisibility.TextControlVisibility, RelativeSource={RelativeSource TemplatedParent}}">
                <TextBlock Text="Page Size: " VerticalAlignment="Center" />
                <TextBox Text="{Binding PageSize,Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" VerticalAlignment="Center" />
                <Border Background="{StaticResource RadPager_Separator1}" HorizontalAlignment="Left" Height="18" Margin="5,0,0,0" VerticalAlignment="Center" Width="1"/>
                <Border Background="{StaticResource RadPager_Separator2}" HorizontalAlignment="Left" Height="18" Margin="0,0,10,0" VerticalAlignment="Center" Width="1"/>
            </StackPanel>


the datapager is bound to domain data source like so

<telerik:RadDomainDataSource QueryName="GetVBinMaster_ALLStock_Ordered" x:Name="ddsStock" AutoLoad="True"  PageSize="250" >
    <telerik:RadDomainDataSource.DomainContext>
        <Stock:InventoryDomainContext x:Name="Inventory" />
    </telerik:RadDomainDataSource.DomainContext>
</telerik:RadDomainDataSource>

<telerik:RadDataPager  x:Name="StockDataPager" Grid.Column="0"
                       Source="{Binding DataView, ElementName=ddsStock}"
                       DisplayMode="All"
                       AutoEllipsisMode="Both"
                       NumericButtonCount="10"
                       IsTotalItemCountFixed="True" Style="{StaticResource RadDataPagerStyle1}" />


there are 666 items in the database table.
if i change the orignal value from 250 to 500 the domaindatasource load is not called

i have included a couple of snapshots
as you can see in my trace window the first 250 were retrieved (auto load) but after the change no load is done.

i feel this is wrong the domaindatasource should be told to load the whole 500 if the size changed.
in fact if the pagesize changes on the domaindata source itself this is the effect

thanks
dco

10 Answers, 1 is accepted

Sort by
0
Nedyalko Nikolov
Telerik team
answered on 20 Jun 2012, 02:10 PM
Hi,

The problem comes from the fact that you are using RadDomainDataSource for paging instead of RadDataPager control. Move setting PageSize="250" from RadDomainDataSource to RadDataPager and everything should work as expected.

Greetings,
Nedyalko Nikolov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
David Ocasio
Top achievements
Rank 2
Iron
Veteran
Iron
answered on 20 Jun 2012, 03:12 PM
as you asked i moved the pagesize from the raddomainsource to the raddatapager but it still shows the same behavior

that is if the pagesize is increased  the pager does not tell the domain source to reload

<telerik:RadDomainDataSource QueryName="GetVBinMaster_ALLStock_Ordered" x:Name="ddsStock" AutoLoad="True"  >
    <telerik:RadDomainDataSource.DomainContext>
        <Stock:InventoryDomainContext x:Name="Inventory" />
    </telerik:RadDomainDataSource.DomainContext>
</telerik:RadDomainDataSource>

<telerik:RadDataPager  x:Name="StockDataPager" Grid.Column="0" PageSize="250"
                       Source="{Binding DataView, ElementName=ddsStock}"
                       DisplayMode="All"
                       AutoEllipsisMode="Both"
                       NumericButtonCount="10"
                       IsTotalItemCountFixed="True" />

I know that the pager is recieving the change cause the count of pages is adjusted properly

thanks
dco
0
Nedyalko Nikolov
Telerik team
answered on 25 Jun 2012, 08:00 AM
Hi,

We need some more time to investigate the issue. We'll update you via this forum thread.

Regards,
Nedyalko Nikolov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Accepted
Rossen Hristov
Telerik team
answered on 26 Jun 2012, 09:11 AM
Hello,

I am afraid that this exact scenario is impossible when using RadDomainDataSource. You can easily achieve this scenario if you use its underlying collection called QueryableDomainServiceCollectionView<T> and bind the pager and the grid directly to it. In this way, you will be able to control its page size via the pager. There is no difference between using the control and the collection -- the control is simply a very thing lightweight wrapper over the collection. All the work is done by the collection anyways.

I have attached a sample project that demonstrates this. I have placed two buttons that change the page size to simulate your altered data pager template.

I hope this helps.

Regards,
Ross
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
David Ocasio
Top achievements
Rank 2
Iron
Veteran
Iron
answered on 26 Jun 2012, 10:05 AM
 thankyou ross for your solution

thanks
dco
0
Accepted
Rossen Hristov
Telerik team
answered on 28 Jun 2012, 08:11 AM
Hello,

I have some good news. We have changed our source code, so now even if you use RadDomainDataSource, when you change the PageSize of the pager, RadDomainDataSource will understand this and act accordingly, i.e. update its PageSize as well and reload data from the server.

This fix will become available with our Latest Internal Build coming out on Monday.

Greetings,
Ross
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
David Ocasio
Top achievements
Rank 2
Iron
Veteran
Iron
answered on 28 Jun 2012, 09:57 AM
excellent

thanks gentleman (ross and Nedyalko Nikolov)  for your assistance
dco
0
David Ocasio
Top achievements
Rank 2
Iron
Veteran
Iron
answered on 03 Jul 2012, 08:42 PM
a minor issue (theoretically)

maybe this should be a new thread
but here it is anyways

I changed my coded to use the QueryableDomainServiceCollectionView as sugggested previously by Ross.
and I bind the "Isbusy" of the gridview  to the "IsBusy" of the QueryableDomainServiceCollectionView.

<telerik:RadGridView x:Name="LocationListGrid" Grid.Row="1" AutoGenerateColumns="False" ShowGroupPanel="False" ShowColumnFooters="False" CanUserInsertRows="False"  IsReadOnly="True"
                     IsBusy="{Binding LocationsQueryViewModel.LocationsDataView.IsBusy,Source={StaticResource InocartCommon}}" ItemsSource="{Binding LocationsQueryViewModel.LocationsDataView,Source={StaticResource InocartCommon}}"
                     SelectionMode="Extended">
Public ReadOnly Property LocationsDataView() As QueryableDomainServiceCollectionView(Of InocartRIAServicesLibrary.Web.Stock.vLocMasterFlags)
    Get
        If _LocationsDataView Is Nothing Then
            ' seperate domain context from everything else 
            Dim InventorydomainContext As New InocartRIAServicesLibrary.Web.Stock.InventoryDomainContext
            Dim query = InventorydomainContext.getStockLocationsQuery
            _LocationsDataView = New QueryableDomainServiceCollectionView(Of InocartRIAServicesLibrary.Web.Stock.vLocMasterFlags)(InventorydomainContext, query)
            _LocationsDataView.AutoLoad = True
        End If
        Return _LocationsDataView
    End Get
End Property
Protected _LocationsDataView As QueryableDomainServiceCollectionView(Of vLocMasterFlags)

if i call the load of the QueryableDomainServiceCollectionView the grid busy indicator does become visible and a load is done
if i move forward to a new page the grid busy indicator does become visible and a load is done

but if i change the pagesize a load is done but the isbusy indicator does not become visible.

not a big problem
but if the page size is large it could cause some issues for some click happy user.

thanks
dco
0
Accepted
Rossen Hristov
Telerik team
answered on 05 Jul 2012, 11:44 AM
Hello,

This only happens when you are at the first page. Anyway, I managed to fix this issue. It will be working properly in the next Latest Internal Build.

Regards,
Ross
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
David Ocasio
Top achievements
Rank 2
Iron
Veteran
Iron
answered on 05 Jul 2012, 01:02 PM
thanks very much ross
i really do appreciate your assistance sir

thanks
dco


Tags
DataPager
Asked by
David Ocasio
Top achievements
Rank 2
Iron
Veteran
Iron
Answers by
Nedyalko Nikolov
Telerik team
David Ocasio
Top achievements
Rank 2
Iron
Veteran
Iron
Rossen Hristov
Telerik team
Share this question
or