Datagrid Next Page Problem

Discussion in 'ASP .Net' started by Marlene A. Roman, May 28, 2004.

  1. Hello I have a question:

    I have a datagrid.
    I can make a specific search using some parameters I write and
    When a press a command button it calls an sp and returns
    the results of a search that is about 25 rows. I show only 13 rows
    so I have the "page paging" property to show the navigation buttons
    "Previos" and "Next". When I select the Next buttom it always shows me the
    same
    records for that page from the first search I made. The first page returns
    me the records I'm loking for, but the next pages don't return the records
    they are supposed
    it looks like is not using the DataSet and it has the recors form the first
    search
    it made. Do I need something aditional to clear the records before doing a
    new search so the next pages get updated?

    thanks so much
    Jenn
     
    Marlene A. Roman, May 28, 2004
    #1
    1. Advertising

  2. Marlene A. Roman

    Raterus Guest

    Do you have something like this?,

    Private Sub myDataGrid_PageIndexChanged(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridPageChangedEventArgs) Handles myDataGrid.PageIndexChanged
    myDataGrid.CurrentPageIndex = e.NewPageIndex
    BindData() 'this would be a sub to whatever sub you use to fill the datagrid
    End Sub

    You need to tell the datagrid to actually move to the next page they clicked on. It seems silly at first, but you'll get used to it.

    --Michael


    "Marlene A. Roman" <> wrote in message news:ORcAZ$...
    > Hello I have a question:
    >
    > I have a datagrid.
    > I can make a specific search using some parameters I write and
    > When a press a command button it calls an sp and returns
    > the results of a search that is about 25 rows. I show only 13 rows
    > so I have the "page paging" property to show the navigation buttons
    > "Previos" and "Next". When I select the Next buttom it always shows me the
    > same
    > records for that page from the first search I made. The first page returns
    > me the records I'm loking for, but the next pages don't return the records
    > they are supposed
    > it looks like is not using the DataSet and it has the recors form the first
    > search
    > it made. Do I need something aditional to clear the records before doing a
    > new search so the next pages get updated?
    >
    > thanks so much
    > Jenn
    >
    >
     
    Raterus, May 28, 2004
    #2
    1. Advertising

  3. I have that function and I use the myDataGrid.CurrentPageIndex =
    e.NewPageIndex.

    After that Should I call the sp that makes the search again? or get the data
    that is stored somewhere?

    Thanks a lot. I Hope I get to use it


    "Raterus" <> wrote in message
    news:%...
    Do you have something like this?,

    Private Sub myDataGrid_PageIndexChanged(ByVal source As Object, ByVal e As
    System.Web.UI.WebControls.DataGridPageChangedEventArgs) Handles
    myDataGrid.PageIndexChanged
    myDataGrid.CurrentPageIndex = e.NewPageIndex
    BindData() 'this would be a sub to whatever sub you use to fill the
    datagrid
    End Sub

    You need to tell the datagrid to actually move to the next page they clicked
    on. It seems silly at first, but you'll get used to it.

    --Michael


    "Marlene A. Roman" <> wrote in message
    news:ORcAZ$...
    > Hello I have a question:
    >
    > I have a datagrid.
    > I can make a specific search using some parameters I write and
    > When a press a command button it calls an sp and returns
    > the results of a search that is about 25 rows. I show only 13 rows
    > so I have the "page paging" property to show the navigation buttons
    > "Previos" and "Next". When I select the Next buttom it always shows me the
    > same
    > records for that page from the first search I made. The first page returns
    > me the records I'm loking for, but the next pages don't return the records
    > they are supposed
    > it looks like is not using the DataSet and it has the recors form the

    first
    > search
    > it made. Do I need something aditional to clear the records before doing a
    > new search so the next pages get updated?
    >
    > thanks so much
    > Jenn
    >
    >
     
    Marlene A. Roman, May 28, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Deniz Bahar
    Replies:
    2
    Views:
    492
    Andrey Tarasevich
    Mar 9, 2005
  2. =?ISO-8859-2?Q?Miros=B3aw?= Makowiecki

    Reading of file by next of map file and by next of file descriptor.

    =?ISO-8859-2?Q?Miros=B3aw?= Makowiecki, Jul 10, 2007, in forum: C++
    Replies:
    1
    Views:
    810
    Alf P. Steinbach
    Jul 10, 2007
  3. Chuck
    Replies:
    0
    Views:
    271
    Chuck
    Jul 5, 2003
  4. Tad McClellan
    Replies:
    3
    Views:
    161
    Edward Wijaya
    May 13, 2004
  5. Liora
    Replies:
    5
    Views:
    691
    Tad McClellan
    Jan 12, 2007
Loading...

Share This Page