According to my book all that is needed to start using automatic paging is to set GridView.AllowPaging to true. But when I try to navigate to another page, I get GridView fired event PageIndexChanging which wasn’t handled exception. I then have to create event handler for PageIndexChanging event, but then when I navigate to next page, GridView doesn’t display anything.
Q1 – What am I doing wrong?
Q2 – Book is written for Asp.Net 3.5, but none of the behavior described above is mentioned by the author?! Any thoughts why my GridView behaves so differently?
thanx
EDIT:
I’m embarassed to say, but reason it didn’t work is because I forgot to remove the line
if(IsPostBack) GridView.DataSourceID='';
Sorry for taking your time and thanx for helping me
When you post back, you’ll have to rebind the data to the gridview.
You may also need to set the page number like: