Myworld
Myworld

Reputation: 1899

paging in gridview

I had gridview which retriev data from database and filter this gridview when I select ddl .and I allow paging in this gridview .But I noticed that when i selected ddl and the gridview get it,s data and I do through pages number in paging and if I stoped in ex.page number 4.And when I selected ddl again the gridview get it,s data but it stop in page number 4.so how can I make gridview return to first page if i selected ddl.

Upvotes: 1

Views: 297

Answers (1)

kevev22
kevev22

Reputation: 3775

In your event handler for the dropdownlist SelectedIndexChanged, add this:

GridView1.PageIndex = 0;

Upvotes: 1

Related Questions