Link to home
Start Free TrialLog in
Avatar of chuang4630
chuang4630

asked on

How to handle the page view in GridView (ASP.NET 2.0) control?

How to handle the page view in GridView (ASP.NET 2.0) control?

how do you use the grdTemplateTrack_PageIndexChanging and grdTemplateTrack_SelectedIndexChanged?

Avatar of Jojo1771
Jojo1771

What are you wanting to do? Grid view has built in pageing (no code needed, unlike the datagrid). Simpy set Allowpaging.

FYI.

Anything ending in "ing" is usually pre event.
And ending in "ed" is post even.

So pre paging and post paging. These events always fire on  a page change.  So you could do custom if you wanted.

You can also set the page manually.

Gridview-> page index =1 or what ever.
Avatar of chuang4630

ASKER

I ran the test with 20 rows of data. There is no  problem to display the first 10 rows. However, when I click the page 2, the page does not change. So I am wondering what may go wrong.

The code to display the data is in If (!IsPostback) clause. No ode outside this clause.

Also, I am windering whether the page change happens n the server or client side?
ASKER CERTIFIED SOLUTION
Avatar of Jojo1771
Jojo1771

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial