Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WPF > DataPager > Custom paging a huge data set

Not answered Custom paging a huge data set

Feed from this thread
  • David avatar

    Posted on Apr 27, 2012 (permalink)

    I am using the RadGridView and RadDataPager in a WPF application. I have a method that pulls pages of Employees from a database (or some other data source). There are more Employees than I want to put in memory at one time, so I need to page the data retrieved from the database.

     

    So, I have a method that returns pages of data in the form of IEnumerable<Employee>. Each IEnumerable<Employee> is one page of data.  The xaml is set up this way:

     

        <Grid>

    ...

            <telerik:RadGridView ItemsSource="{Binding PagedSource, ElementName=radDataPager}"

                                 Horizontal Alignment="Left"

                                 AutoGenerateColumns="False"

                                 x:Name="radGridView1"

                                 VerticalAlignment="Top"

                                 Height="Auto"

                                 Width="Auto"

                                 Grid.Row="0">

                <telerik:RadGridView.Columns>

                    <telerik:GridViewDataColumn DataMemberBinding="{Binding FirstName}"

                                                Header="First Name"

                                                UniqueName="FirstName" />

                    <telerik:GridViewDataColumn DataMemberBinding="{Binding LastName}"

                                                Header="Last Name"

                                                UniqueName="LastName" />

                    <telerik:GridViewDataColumn DataMemberBinding="{Binding Age}"

                                                Header="How Old?"

                                                UniqueName="Age" />

                </telerik:RadGridView.Columns>

            </telerik:RadGridView>

            <telerik:RadDataPager x:Name="radDataPager"

                                  Source="{Binding Employees2}"

                                  DisplayMode="FirstLastPreviousNext"

                                  IsTotalItemCountFixed="False"

                                  PageSize="3"

                                  Grid.Row="1"

                                  Margin="0,9,0,0"

                                  PageIndexChanging="radDataPager_PageIndexChanging"

                                  PageIndexChanged="radDataPager_PageIndexChanged"/>

        </Grid>

     

    I only get the first page with 3 records. Can this be fixed, or am I trying to do something that these controls do not support?

     

    What would be a better way to do what I am trying to do?

     

    Thanks.

     

    David

     

     

     

    Reply

  • Rossen Hristov Rossen Hristov admin's avatar

    Posted on Apr 30, 2012 (permalink)

    Hello,

    The PageSize of your pager is set to 3, so it is quite normal to get a page containing 3 records.

    Maybe in your case you should consider the Unbound Mode of RadDataPager which allows you to page anything in any way.

    Please, read my blog post to learn more about the pager.

    Regards,
    Ross
    the Telerik team

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

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WPF > DataPager > Custom paging a huge data set