DataGrid Pagination

  • Thread starter Joseph D. DeJohn
  • Start date
J

Joseph D. DeJohn

I am trying to get pagination working on a datagrid. Can anyone point me to
a resource for help on this? I'm not sure if custom paging is the best
option or not.
 
Y

Yangtsi River

hi,
I posted a similar post below.
datagrid does paging for you, u just set AllowPaging=true for datagrid.
it's said that custom paging is not paging at all, no page index appeared
at the bottom if you use custom paging.

what kind of datasource u r using for datagrid control,it seems that
matters
too.

Yangtsi.
 
J

Joseph D. DeJohn

I saw your post, but the default pagination is having problems working. I
opted for the only other alternative. You can guess. I am using a SQL
datasource. Can't believe you are having problems with custom paging also.
Dunno what to think at this point.
 
D

Daniel Bass

allowpaging passes control to the datagrid to take care of most of it, all
it means is the control divides up the page according to your page count,
you still have to instantiate a post back procedure that handles switching
to the different pages...

custom pages does work, but it doesn't split the pages up for you, you've
more control, and hence have to do more work with the control to get the
results you want... (you may want all the records in may 2000 in one page,
for example, and there may be more in june, so a straight count that the
allowpaging uses wouldn't work...)

the postback method is easy enough.

Sub MyDBgrid_Paging(sender As Object, e As DataGridPageChangedEventArgs)
MyDBgrid.CurrentPageIndex = e.NewPageIndex
BindData()
End Sub


this simply gets the number that was clicked on from 'e', then tell the grid
what page it's on before binding the data.

good luck
 

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,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top