Help with strange paging problem.

G

Gaz

I have a web form with a datagrid with paging. I keep the datagrid
items in an ArrayList in the session object. My problem is that the
page links (1 2 3 etc) do not appear when they should ie; when the
number of items in the array list (which is bound to the datagrid)
exceeds the datagrid's page size.

And this is why it's strange.. The paging links do appear if I press
F5 a few times on the page and add an item to the ArrayList in the
Page_Load() function to build up the datagrid. But when I setup an
asp:linkbutton to go back to the server the paging links do not appear
when the page size is exceeded. This is strange because the ArrayList
is updated, the datagrid (which represents a shopping basket) knows
about the ArrayList with the extra item/s. The first page of the
datagrid builds up but when the paging links are required, they just
don't show up.

If it makes a difference the datagrid is in a .ascx.

Please help if you can, this is getting on my nerves.
 
G

Gaz

I'm still bothered by this.. Here's an update :

If I use the LinkButton (to go back to the server and add an item to
the ArrayList which is then DataBinded) then the DataGrid.Items.Count
never exceeds the DataGrid.PageCount. This is why the paging links
never appear. If I change the PageSize then the DataGrid.Items build
up incrementally to the new PageSize, but no higher.

Strangely, as I mentioned in my first post, if I just press F5 (to go
back to the server and add an item to the ArrayList which is then
DataBinded) then the DataGrid.Items.Count builds up incrementally and
doesn't stop at DataGrid.PageCount, and so the pageing links appear.

Why? Why? Why!!
 
G

Gaz

If anyone has a fix for this then great.. But I've circumnavigated the
problem by writing my own class which returns the html for the
shopping basket. asp:DataGrid no more! Paging works in my class,
that's all I care about.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,172
Latest member
NFTPRrAgenncy
Top