Custom paging a huge data set

2 posts, 0 answers
  1. David
    David avatar
    1 posts
    Member since:
    Apr 2012

    Posted 27 Apr 2012 Link to this post

    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

     

     

     

  2. Rossen Hristov
    Admin
    Rossen Hristov avatar
    2478 posts

    Posted 30 Apr 2012 Link to this post

    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 >>

  3. UI for WPF is Visual Studio 2017 Ready
Back to Top