Problem with "Custom paging" of DataGrid control

Discussion in 'ASP General' started by Alex, Sep 14, 2003.

  1. Alex

    Alex Guest

    I created a page to show RealEstate Data with images
    retrived from the MSSQL 2000. I am using a DataGrid
    control:

    <asp:datagrid
    AllowPaging="True"
    OnPageIndexChanged="Pageindexchanged"
    >


    Sub PageIndexChanged(ByVal sende.........)
    myDataGrid.CurrentPageIndex = e.NewPageIndex
    myDataGrid.DataBind()
    End Sub

    It works just fine and I am able to go thru the records.
    The problem begins when I trying to implement Custom
    paging which is a very important for large number of
    records and aspetially in my case with a images,becouse if
    you using a Custom paging the page is receiving only
    current record baced od page index.
    So, when I am chenging my code to:

    <asp:datagrid
    AllowPaging="True"
    AllowCustomPaging="True"
    OnPageIndexChanged="Pageindexchanged"
    >


    Sub PageIndexChanged(ByVal sende.........)
    intStartIndex = (e.NewPageIndex * myDataGrid.PageSize)
    myDataGrid.CurrentPageIndex = e.NewPageIndex
    BindDataGrid()
    End Sub

    the event OnPageIndexChanged become not available! I have
    no idea what is happened. I got the same sittuation with
    Sorting event.
    I will be appretiate for any help.
    Alex.
    Alex, Sep 14, 2003
    #1
    1. Advertising

  2. Alex

    Alex Guest

    Figured it out,thanks!
    I had an error in Form load event,this is why the next
    event was not show up.I just do not understant why I did
    not get any error msg.
    Alex.
    >-----Original Message-----
    >I created a page to show RealEstate Data with images
    >retrived from the MSSQL 2000. I am using a DataGrid
    >control:
    >
    ><asp:datagrid
    >AllowPaging="True"
    >OnPageIndexChanged="Pageindexchanged"
    >>

    >
    >Sub PageIndexChanged(ByVal sende.........)
    > myDataGrid.CurrentPageIndex = e.NewPageIndex
    > myDataGrid.DataBind()
    >End Sub
    >
    >It works just fine and I am able to go thru the records.
    >The problem begins when I trying to implement Custom
    >paging which is a very important for large number of
    >records and aspetially in my case with a images,becouse

    if
    >you using a Custom paging the page is receiving only
    >current record baced od page index.
    >So, when I am chenging my code to:
    >
    ><asp:datagrid
    >AllowPaging="True"
    >AllowCustomPaging="True"
    >OnPageIndexChanged="Pageindexchanged"
    >>

    >
    >Sub PageIndexChanged(ByVal sende.........)
    > intStartIndex = (e.NewPageIndex * myDataGrid.PageSize)
    > myDataGrid.CurrentPageIndex = e.NewPageIndex
    > BindDataGrid()
    >End Sub
    >
    >the event OnPageIndexChanged become not available! I have
    >no idea what is happened. I got the same sittuation with
    >Sorting event.
    >I will be appretiate for any help.
    >Alex.
    >
    >
    >.
    >
    Alex, Sep 14, 2003
    #2
    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. Paul Hobbs
    Replies:
    1
    Views:
    598
    Chuck Haeberle
    Jul 24, 2003
  2. anon
    Replies:
    0
    Views:
    456
  3. SOS

    datagrid and custom paging

    SOS, Jun 25, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    315
  4. =?Utf-8?B?UmFlZCBTYXdhbGhh?=

    DataGrid Custom Paging Problem

    =?Utf-8?B?UmFlZCBTYXdhbGhh?=, Feb 16, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    402
    =?Utf-8?B?UmFlZCBTYXdhbGhh?=
    Feb 16, 2005
  5. SStory

    Datagrid custom paging problem

    SStory, Sep 19, 2003, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    152
    SStory
    Sep 20, 2003
Loading...

Share This Page