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

Custom paging a huge data set

1 Answer 148 Views
DataPager
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 27 Apr 2012, 09:21 PM

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

 

 

 

1 Answer, 1 is accepted

Sort by
0
Rossen Hristov
Telerik team
answered on 30 Apr 2012, 09:02 AM
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 >>

Tags
DataPager
Asked by
David
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
Share this question
or