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

RadGrid Paging not working with RadAjaxManager

5 Answers 152 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Stephen
Top achievements
Rank 1
Stephen asked on 29 Sep 2008, 03:39 PM
Hi,

I have a RadGrid with paging enabled.  Ajax is disabled on the RadGrid, and a RadAjaxManager has been configured with the RadGrid as both the source and target for Ajax in the manager GUI.

However whenever I click a page now, the grid collapses as though there is no data, when there should be 20+ pages of data.

What am I doing wrong?  Is this to do with ViewState, or how I have ajaxified my RadGrid?

Regards

SM

5 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 30 Sep 2008, 05:52 AM
Hi Stephen,

How the grid is bound in your case? NeedDataSource or DataSourceID?

Regards,
Vlad
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Stephen
Top achievements
Rank 1
answered on 30 Sep 2008, 07:37 AM
Hi,

I am not using a SQLDataSource, but am binding manually when the Telerik PageView containing the grid is selected.

Me.grdStudyMilestones.DataSource = dsFinal
grdStudyMilestones.DataBind()


Regards

i
0
Sebastian
Telerik team
answered on 30 Sep 2008, 08:34 AM
Hi Stephen,

If you use simple binding for the grid with DataBind() calls, you will need to handle sorting/paging operations manually with code in the same way as with the regular MS GridView control.

However, since the simple binding has some limitations (built-in grouping, filtering, custom edit forms, etc. are not supported with this binding mode), I suggest you move to advanced binding through the NeedDataSource event.

Best regards,
Stephen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Stephen
Top achievements
Rank 1
answered on 30 Sep 2008, 08:40 AM
Hi,

I will try this.  Does this mean that when I move from pag 1 to page 2, NeedDataSource will fire and re--run the stored procedure? 

Is this the way paging works? I was hoping that round trips to the database would not be necessary to move from one page to another?  Is this not the case?

Regards

i
0
Sebastian
Telerik team
answered on 30 Sep 2008, 08:46 AM
Hello Stephen,

If you do not want to hit the database each time the NeedDataSource event is raised, consider storing the grid source in Cache/ViewState object and retrieve it from there on subsequent control lifecycle iterations. More about the RadGrid event lifecycle you can learn from this article.

Regards,
Stephen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
Stephen
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Stephen
Top achievements
Rank 1
Sebastian
Telerik team
Share this question
or