Results 1 to 6 of 6

Thread: [2005] DataGrid Paging help...

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2008
    Location
    Texas
    Posts
    1,288

    [2005] DataGrid Paging help...

    To be honest, I thought if you databound the grid, it would automatically page for you if you had allowpaging = true.

    But evidentally you have to handle the PageIndexChanging event.
    But what would I put in there?

    Thanks,

    Justin Fox
    You down with OOP? Yeah you know me!
    MCAD and MCMICKEYMOUSE (vb.net)

    ----

    If it even kinda helps... rate it : )

    Edit a Multi-page .tif file and save.

  2. #2
    Fanatic Member
    Join Date
    Jun 2004
    Location
    All useless places
    Posts
    917

    Re: [2005] DataGrid Paging help...

    If you have bound the gridview (I assumed you meant Gridview instead of DataGrid) to a DataSourceControl then you don't need to do anything special for paging to happen. but if you bind it to a datatable then you have to do additional processing.
    What is it that you are trying to achieve and what are the specific issues you are facing?

  3. #3
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,173

    Re: [2005] DataGrid Paging help...

    Set the page's index property to the new page number. Rebind it.

  4. #4

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2008
    Location
    Texas
    Posts
    1,288

    Re: [2005] DataGrid Paging help...

    ok, so if you just do grid.pageindex = e.newpageindex and then
    just rebind the grid, the grid will know what new items to show on the
    next page?

    Actually, I put 'grid.pageindex = e.newpageindex, but the little paging links are all jacked up. Like if I click on link '2' nothing happens, but if i click on '3' then it will move to '2'.

    I might just try the DataSourceControl thingy.

    Thanks for the help,

    Justin Fox
    You down with OOP? Yeah you know me!
    MCAD and MCMICKEYMOUSE (vb.net)

    ----

    If it even kinda helps... rate it : )

    Edit a Multi-page .tif file and save.

  5. #5
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: [2005] DataGrid Paging help...

    As mentioned by mendhak, call grid.DataBind again, after the grid.pageindex = e.newpageindex statement (if you are not using a datasource control).

  6. #6

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2008
    Location
    Texas
    Posts
    1,288

    Re: [2005] DataGrid Paging help...

    I forgot about the whole rebind thing, get off track sometimes.
    I'll post tonight whether I was successfull or not.

    Thanks Again!

    Justin
    You down with OOP? Yeah you know me!
    MCAD and MCMICKEYMOUSE (vb.net)

    ----

    If it even kinda helps... rate it : )

    Edit a Multi-page .tif file and save.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width