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

How to setup Paging for RadGrid?

1 Answer 96 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Pooya
Top achievements
Rank 1
Pooya asked on 18 Aug 2011, 12:12 PM
I'm trying to setup paging for RadGrid and it works fine in some scenarios but there are 3 issues with it:

@  Load the page initially, go to the second page, then go back to the first page; the data is not updated so shows the second page data!

@ Load the page initially, change the page size from 10 to 50. expect: the page should immediately be reloaded with the new page size. actual: no change. generally something wrong with the first page!

@ pdf icon disappears when clicking any page number apart from the first. It appears again when the first page number is clicked but the data has the above issue.

Maybe it's not configured properly (it's generated using my RadGridBuilder class). I have set the below properties:

            this.RadGrid.AllowPaging = this.AllowPaging;
            this.RadGrid.PagerStyle.Mode = GridPagerMode.NextPrevAndNumeric;

private void RadGridNeedDataSource(object sender, GridNeedDataSourceEventArgs e)
        {
            this.RadGrid.DataSource = this.DataSource;
        }

My Build method is responsible to buld the RadGrid basically:

 public RadGrid Build()
        {
            this.DataSource = GetDataSource();

            SetImmediateProperties();

            SetMasterTableView();

            ConfigureExportSettings();

            this.RadGrid.Rebind();

            return this.RadGrid;
        }

Why do I have the above issues and how to resolve them?

After further investigation, it's clarified that PageIndexChanged event is never raised when the page number 1 is clicked. Not sure why?

Very much appreciated.

1 Answer, 1 is accepted

Sort by
0
Iana Tsolova
Telerik team
answered on 23 Aug 2011, 08:30 AM
Hello Pooya,

Where is the Build() method called? Try removing the Rebind() call from it and see if it makes any difference.
Additionally, if you are creating the grid programatically, check the below article and confirm you followed the steps described there:
http://www.telerik.com/help/aspnet-ajax/grid-programmatic-creation.html

Regards,
Iana
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Tags
Grid
Asked by
Pooya
Top achievements
Rank 1
Answers by
Iana Tsolova
Telerik team
Share this question
or