Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > RadControls in DotNetNuke > Radgrid paging not working without OnNeedDataSource?

Not answered Radgrid paging not working without OnNeedDataSource?

Feed from this thread
  • pjDev avatar

    Posted on Jan 26, 2012 (permalink)

    I am checking my understanding here.  I am new to the RAD products.  I am using a RADGRID and I load the datasource of the with about 3 pages of data with AllowPaging="true" AllowCustomPaging="false" PagSize="10"

    From what I read, I thought loading 30 records into the grid and setting it up this way would have RadGrid allow and manage all the paging on the client side without any further effort or work on my part.  Is this the way it can work?  The reason I ask, is it loads fine and tells me I have three pages and I have the option of selecting the scrolling through those pages as a user; but when I click page 2 from page one. The entire grid vanishes off my screen.  It appears as though it loses all of its data.  It is posting back to the server too, which I did not expect.  In that postback, tracing shows the grid is still loaded.

    I have been able to get a work around of reloading all of the data to the grid each time the user pages up or down using AllowCustomPaging="true" and OnNeedDataSource="grdMine_OnNeedDataSourceServerSide" where it reloads the entire grid and seems to page to the next or previous page without me doing anything other than reloading the entire grid with data.    This seems very counter intuitive.  If I am going to have paging, it is a complete waste of CPU, throughput and SQL server to have it reload the entire grid every time. By the way, at entry to OnNeedDataSource the e.RebindReason is PostBackEvent.)

    So, does Telerik RadGrid support completely autonomous paging on the client side with minimal to no effort like I believe it does?

    If not, what should I do to prevent so much waste in my overhead with my current work around?

    Reply

  • jumpstart Master avatar

    Posted on Jan 27, 2012 (permalink)

    pjDev:

    You asked: "So, does Telerik RadGrid support completely autonomous paging on the client side with minimal to no effort like I believe it does?"

    Absolutely. 

    Take a look at the Grid / Basic Paging online demo to see this in action. This demo does not use OnNeedDataSource at all.

    Perhaps you should post your original code that displayed the blank RadGrid on paging from 1 -> 2. This would help to identify what is wrong.

    Hope this helps!

    Reply

  • pjDev avatar

    Posted on Jan 27, 2012 (permalink)

    So, let me check my understanding of what I think I am reading here.  The radgrid does support an option where you loaded the datasource one time in an initial binding and then the radgrid manages the data it has (on the client side) for paging, filtering, etc without having to come back and get the data all over again.  Is that what you are saying?

    If so, this is not what I am encountering.  I will look over that example and see if there is any difference at all.
    Would you expect a post back the moment I (as a user) change pages?  I am thinking this might be the issue.

    Reply

  • jumpstart Master avatar

    Posted on Jan 27, 2012 (permalink)

    pjDev:

    Yes, since the paging is handled server-side, a postback is required. The way it works is to only transfer one page of data from the server at a time. It needs to post back to get the next page.

    You can refer to the Basic Paging documentation page where the first line reads:

    "When displaying a large set of data in web applications it is a common practice that only a small sub-set of the data at a time would be transferred to the client and operated with. Telerik RadGrid supports this functionality automatically and also provides a set of events, helper methods and properties if the paging operation requires custom intervention."

    So, you should not have to manually provide the data with each new page.

    Regards,

    Reply

  • pjDev avatar

    Posted on Jan 27, 2012 (permalink)

    "Yes, since the paging is handled server-side, a postback is required. The way it works is to only transfer one page of data from the server at a time. It needs to post back to get the next page."

    Here is where my confusion comes in.  I am discussing everything being handled on the client side without the need to come back for data.  You just agreed with me that it does not need to come back, but described a postback that would be calling OnNeedDataSource in your sentence above.  This is completely contradictory to what I am asking, but what you are describing is what is happening.  This is what I need to get cleared up.  Your description of getting data, would be calling OnNeedDataSource.

    Is there a way to send the entire mass of data (which is what actually happens on the first call regardless), and have the grid manage all that data, paging, and filtering from the CLIENT side WITHOUT the need to return for the data with each user filter or paging request.  If the RadGrid needed something, it would be posting back.  It is the postback that is requesting the data for the grid.  If I ignore that request for the data, the grid goes blank and disappears.  It is that need for data that is killing me.  I have to send the entire dataset back to the screen each time.  If I only send the next screen, it shows a grid with ONLY ONE SCREEN full and removes the paging capacity.  The only way I can get it to work is send the entire set of data every time.  I want to send it once and have the grid manage it.  They have it, so manage it.  I hope this helps eliminate the confusion that must have occurred in your reply.

    Reply

  • pjDev avatar

    Posted on Jan 28, 2012 (permalink)

    I took some time to review...

    • Absolutely. 
    • Take a look at the Grid / Basic Paging online demo to see this in action. This demo does not use OnNeedDataSource at all.

    And here are my findings...
    While the example you supply above does not use OnNeedDatasource, it does use DataSourceID="SqlDataSource1", which does the exact same thing.  It goes to the server on a postback and gets the entire dataset all over again with each 'page' request from the client side.  This is what I am trying to avoid.

    I put this question back out to the community again, is there a way where I can have the RadGrid take the initial databind of the entire dataset and manage the data it has ON THE CLIENT SIDE automatically.  The docs seem to imply this, but I can find no examples that I run on my machine that don't post back and request the data.  If I choose to ignore the postback the grid goes blank because it has no data.  I am inclined to believe that RadGrid does not support the feature I am asking about.  Can someone confirm this one way or the other, and if it can supply code that actually does what I am proposing?

    Thanks much!

    Reply

  • jumpstart Master avatar

    Posted on Jan 30, 2012 (permalink)

    PJ:

    Not sure if you found this, but your requirement is also covered in the client side paging and sorting of RadGrid .

    Regards,

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > RadControls in DotNetNuke > Radgrid paging not working without OnNeedDataSource?