Professional Web Applications Themes

Paging Problems - ASP.NET Data Grid Control

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 ...

  1. #1

    Default Paging Problems

    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 Guest

  2. #2

    Default Re: Paging Problems

    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.DataGridPageChangedEvent Args) Handles
    grdPLOFDetail.PageIndexChanged

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

    ian


    "Wesley Robinson" <robinsonwsparta.com> wrote in message
    news:#Z2mdyWHEHA.3476TK2MSFTNGP11.phx.gbl...
    > 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 Guest

  3. #3

    Default Re: Paging Problems

    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" <ian_oldburylineone.net> wrote in message
    news:%2303dWKaHEHA.3128TK2MSFTNGP12.phx.gbl...
    > 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.DataGridPageChangedEvent Args) Handles
    > grdPLOFDetail.PageIndexChanged
    >
    > And in the aspx file within the datagrid
    > have
    > allowpaging="True"
    >
    > ian
    >
    >
    > "Wesley Robinson" <robinsonwsparta.com> wrote in message
    > news:#Z2mdyWHEHA.3476TK2MSFTNGP11.phx.gbl...
    > > 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 Guest

  4. #4

    Default Re: Paging Problems

    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$nSlHEHA.3240TK2MSFTNGP12.phx.gbl...
    > 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" <robinsonwsparta.com> wrote in message
    > news:%23Z2mdyWHEHA.3476TK2MSFTNGP11.phx.gbl...
    > > 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 Guest

  5. #5

    Default Re: Paging Problems

    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" <robinsonwsparta.com> wrote in message
    news:%23Z2mdyWHEHA.3476TK2MSFTNGP11.phx.gbl...
    > 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 Guest

Similar Threads

  1. problems paging a recordset search result
    By CharitiesOnline in forum ASP Database
    Replies: 1
    Last Post: July 3rd, 10:21 AM
  2. Problems with paging.
    By Lars Gr?tteland in forum ASP.NET Data Grid Control
    Replies: 3
    Last Post: April 14th, 04:15 PM
  3. problems with Paging
    By vauk in forum ASP.NET Data Grid Control
    Replies: 0
    Last Post: July 13th, 07:53 AM
  4. More problems with DataGrid Editing while using custom Paging
    By lloyd in forum ASP.NET Data Grid Control
    Replies: 0
    Last Post: May 27th, 11:24 PM
  5. Custom paging problems - first page always displayed
    By Oleg Ogurok in forum ASP.NET Data Grid Control
    Replies: 1
    Last Post: July 9th, 01:39 PM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139