Paging Problems

Discussion in 'ASP .Net Datagrid Control' started by Wesley Robinson, Apr 8, 2004.

  1. I am having problems getting paging to work on one of my datagrid controls.
    I am developing in Visual Studio.NET and I have tried using both the built
    in MyDatagrid_PageIndexChanged event and tried making my own function and
    calling it with the onpageindexchanged attribute of the datagrid element.
    In either case, it never calls the function and simply reloads the page and
    my datagrid vanishes. I am creating the datagrid dynamically by selecting a
    table from a dropdown list then selecting what fields I want from a listbox
    and hitting a select button. I am stumped. Does anyone have any ideas on
    what I might be missing?

    Thanks,
    Wesley
    Wesley Robinson, Apr 8, 2004
    #1
    1. Advertising

  2. Wesley Robinson

    Ian Oldbury Guest

    Hi Wesley

    Does you codebehind page have the handles reference?

    Private Sub grdPLOFDetail_PageIndexChanged(ByVal source As System.Object,
    ByVal e As System.Web.UI.WebControls.DataGridPageChangedEventArgs) Handles
    grdPLOFDetail.PageIndexChanged

    And in the aspx file within the datagrid
    have
    allowpaging="True"

    ian


    "Wesley Robinson" <> wrote in message
    news:#...
    > I am having problems getting paging to work on one of my datagrid

    controls.
    > I am developing in Visual Studio.NET and I have tried using both the built
    > in MyDatagrid_PageIndexChanged event and tried making my own function and
    > calling it with the onpageindexchanged attribute of the datagrid element.
    > In either case, it never calls the function and simply reloads the page

    and
    > my datagrid vanishes. I am creating the datagrid dynamically by selecting

    a
    > table from a dropdown list then selecting what fields I want from a

    listbox
    > and hitting a select button. I am stumped. Does anyone have any ideas on
    > what I might be missing?
    >
    > Thanks,
    > Wesley
    >
    >
    Ian Oldbury, Apr 8, 2004
    #2
    1. Advertising

  3. My code behind has the handles reference and allow paging is set to true. I
    haven't had a problem setting up paging before, but for some reason in this
    instance, when I select a page from the page index, it just calls Page_Load
    but doesn't call the _PageIndexChanged function.

    Thanks


    "Ian Oldbury" <> wrote in message
    news:%...
    > Hi Wesley
    >
    > Does you codebehind page have the handles reference?
    >
    > Private Sub grdPLOFDetail_PageIndexChanged(ByVal source As

    System.Object,
    > ByVal e As System.Web.UI.WebControls.DataGridPageChangedEventArgs) Handles
    > grdPLOFDetail.PageIndexChanged
    >
    > And in the aspx file within the datagrid
    > have
    > allowpaging="True"
    >
    > ian
    >
    >
    > "Wesley Robinson" <> wrote in message
    > news:#...
    > > I am having problems getting paging to work on one of my datagrid

    > controls.
    > > I am developing in Visual Studio.NET and I have tried using both the

    built
    > > in MyDatagrid_PageIndexChanged event and tried making my own function

    and
    > > calling it with the onpageindexchanged attribute of the datagrid

    element.
    > > In either case, it never calls the function and simply reloads the page

    > and
    > > my datagrid vanishes. I am creating the datagrid dynamically by

    selecting
    > a
    > > table from a dropdown list then selecting what fields I want from a

    > listbox
    > > and hitting a select button. I am stumped. Does anyone have any ideas

    on
    > > what I might be missing?
    > >
    > > Thanks,
    > > Wesley
    > >
    > >

    >
    >
    Wesley Robinson, Apr 8, 2004
    #3
  4. Wesley Robinson

    Ian Oldbury Guest

    Sorry for the delay, we've had a holiday over here in the uk.

    I've got a different signature for the PageIndexChanged event
    ByVal source As System.Object

    Sometimes we found that an event lost its link with the control, god knows
    why. And the way to sort it was delete it(and all events to the grid) and
    then add it again (just copying the code into notepad seemed to work).

    To be honest i've no other idea's, which is no help whatsoever.
    Sorry, but i'll keep thinking.

    ian

    "Wesley Robinson" <> wrote in message
    news:%23Xe$...
    > OK, I am attaching my code because I am simply at a loss...this is a

    simple
    > page and I just don't see a problem.
    >
    > Thanks,
    > Wesley
    >
    > "Wesley Robinson" <> wrote in message
    > news:%...
    > > I am having problems getting paging to work on one of my datagrid

    > controls.
    > > I am developing in Visual Studio.NET and I have tried using both the

    built
    > > in MyDatagrid_PageIndexChanged event and tried making my own function

    and
    > > calling it with the onpageindexchanged attribute of the datagrid

    element.
    > > In either case, it never calls the function and simply reloads the page

    > and
    > > my datagrid vanishes. I am creating the datagrid dynamically by

    selecting
    > a
    > > table from a dropdown list then selecting what fields I want from a

    > listbox
    > > and hitting a select button. I am stumped. Does anyone have any ideas

    on
    > > what I might be missing?
    > >
    > > Thanks,
    > > Wesley
    > >
    > >

    >
    >
    >
    Ian Oldbury, Apr 13, 2004
    #4
  5. I think I've narrowed down (or perhaps broadened ) my problem to this, when
    AutoGenerateColumns is set to False, I lose my datagrid whenever the page
    executes a postback. When AutoGenerateColumns is set to True, I don't have
    any problems but I need to be able to set AutoGenerateColumns = False.


    "Wesley Robinson" <> wrote in message
    news:%...
    > I am having problems getting paging to work on one of my datagrid

    controls.
    > I am developing in Visual Studio.NET and I have tried using both the built
    > in MyDatagrid_PageIndexChanged event and tried making my own function and
    > calling it with the onpageindexchanged attribute of the datagrid element.
    > In either case, it never calls the function and simply reloads the page

    and
    > my datagrid vanishes. I am creating the datagrid dynamically by selecting

    a
    > table from a dropdown list then selecting what fields I want from a

    listbox
    > and hitting a select button. I am stumped. Does anyone have any ideas on
    > what I might be missing?
    >
    > Thanks,
    > Wesley
    >
    >
    Wesley Robinson, Apr 13, 2004
    #5
    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. =?Utf-8?B?UGF0cmljay5PLklnZQ==?=

    DataSet paging vs Datareader paging

    =?Utf-8?B?UGF0cmljay5PLklnZQ==?=, Oct 8, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    10,651
    Scott Allen
    Oct 8, 2004
  2. Franck Diastein

    Paging related problems

    Franck Diastein, Jan 12, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    316
    Franck Diastein
    Jan 12, 2005
  3. wh1974
    Replies:
    0
    Views:
    2,416
    wh1974
    Jan 12, 2005
  4. Red
    Replies:
    1
    Views:
    702
  5. Ruy Castelli

    DataGrid - Paging problems

    Ruy Castelli, May 1, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    2,574
    Elton W
    May 1, 2005
Loading...

Share This Page