GridView not paging correctly

  • Thread starter Thread starter Ronald S. Cook
  • Start date Start date
R

Ronald S. Cook

I have an ASP.NET GridView that gets its data from an object (i.e. filling a
datatable, no datasourceid). I have the PageIndexChanging event captured
and have the following code in it:

gdvProduct.PageIndex = e.NewPageIndex;

gdvProduct.DataBind();


But I'm getting a blank page when I go to the next page.

Any ideas?

Thanks,
Ron
 
You are not rebinding the data.

The norm is this

In Page Load routine, in not is postback section
--------

1. Bind grid
2. Save dataset

In DataGrid index change routine
-------

Change page and bind

I have samples (albeit 1.0) on the Wiley extras site
(http://www.wiley.com/extras). Look for the book ADO.NET and XML: ASP.NET on
the Edge and download chapter 16 (VS version is Visual Studio,; SDK version
is SDK with batch files that act like make scripts). It is VB.NET, so you
will have to translate if you are using C# or J#.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com

*********************************************
Think outside the box!
*********************************************
 
Back
Top