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

NeedDataSource fires on next page

4 Answers 69 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 24 Aug 2010, 11:56 PM

When I push the next page plik on a RadGrid the NeedDataSource event fires.  How do I get the grid to handle paging without hitting the database each time?

<telerik:RadGrid 
        ID="RadGrid1" 
        runat="server" 
        Width="100%" 
        Height="100%" 
        GridLines="None"
        AutoGenerateColumns="False" 
        AllowSorting="True"
        AllowFilteringByColumn="True" 
        SelectedItemStyle-BackColor="LightBlue" AllowPaging="True" 
        onneeddatasource="RadGrid1_NeedDataSource" PageSize="100">

4 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 25 Aug 2010, 09:32 AM
Hello Michael,

When RadGrid current page is changed, sort, filter or insert/update/delete operations are performed, RadGrid is being implicitly rebound. You can find more information on the RadGrid lifecycle in the below articles:

http://www.telerik.com/help/aspnet-ajax/grdeventsequence.html
http://www.telerik.com/help/aspnet-ajax/grdcommandsthatinvokerebindimplicitly.html

Best wishes,
Pavlina
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Michael
Top achievements
Rank 1
answered on 25 Aug 2010, 04:22 PM
Even though I queried the data source and got all the records (say 1000) and my page size is set to 100 in the grid.  When the user hits the page button,I have to go back to the database for the data again?

0
Pavlina
Telerik team
answered on 26 Aug 2010, 11:31 AM
Hi Michael,

I am sending you a simple working project which handles the desired functionality. Please give it a try and let me know if it works for you.

Best wishes,
Pavlina
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Michael
Top achievements
Rank 1
answered on 26 Aug 2010, 05:24 PM
Pavlina;
Thank you for your help.  That was just what I wanted!
Tags
Grid
Asked by
Michael
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Michael
Top achievements
Rank 1
Share this question
or