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

[Solved] radgrid custom pagination when total number of records is not known

1 Answer 608 Views
Grid
This is a migrated thread and some comments may be shown as answers.
payk
Top achievements
Rank 1
payk asked on 05 Mar 2014, 12:57 PM
I am using telerik radgrid in my .net aspx page. I want to implement
custom pagination. But for this i don't have the total record count
initially. Want to get more data from server when user clicks on the
next page link after reaching the last page.

Example: if initially only 10 records are displayed on 1st page. If i
click "Next" link it should fetch next set of data.

But issue is: "Next" button do not fire OnCommand or OnItemCommand
events, if there are no more next pages.

So the question is how to handle pagination when total number of records
is not knows initially?
Which radgrid event to handle to get "Next" button click event
irrespective of whether grid is already displaying last page or not.

1 Answer, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 10 Mar 2014, 07:53 AM
Hello Payk,

If you are not setting the VirtualItemCount property of the RadGrid that will show how many pages should be displayed in the pager and you have only 1 page it is expected that no command will fire if you click on the Next button. Bellow is a simple example for setting the RadGrid to use custom paging:
<telerik:RadGrid ID="RadGrid1" runat="server" OnNeedDataSource="RadGrid1_NeedDataSource" AllowPaging="true"
     AllowCustomPaging="true" PagerStyle-AlwaysVisible="true" PageSize="10" VirtualItemCount="100000"
    OnItemCommand="RadGrid1_ItemCommand">
</telerik:RadGrid>

Detailed information on Custom Paging and an online demo are available at the following links:

Please take a look at the above links and see how the custom paging should be handled.

Hope that helps.


Regards,
Konstantin Dikov
Telerik

DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.

Tags
Grid
Asked by
payk
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Share this question
or