Pagination Problem With CSSFriendly Gridview RRS feed

  • Question

  • User1564426328 posted

    I'm having an odd problem with the CSSFriendly Gridview but I can't find any information about the problem.  ...anywhere...

    The pagination controls display at the bottom of the grid as they should be.  But when I click a page number or the page advance link I get an error message and no changes to the display instead of getting the requested subset of data.

    Error: 'panelElement' is null or not an object

     Has anyone else experienced this behavior?  If so, how did you get around it?

     Also, before anyone asks, I have tried it with and without the gridview adapter being used.  And it only happens when the gridview adapter is being used.






    Thursday, December 18, 2008 3:13 PM

All replies

  • User1564426328 posted

    Hello everyone,

     I have more information on my problem.  I've narrowed down what specifically is causing the "Error: 'panelElement' is null of not an object".

    The ID for the primary DIV of the gridview is different from the ID that the ASP.NET generated pagination code is expecting.

    Here's the specific case:

    • The gridview is named "gvChart" within the ASP.NET code.
    • The regular Gridview generates <div id="__gvctl00_cphMain_gvChart__div"> that surrounds the Gridview.
    • However, the CSS Friendly Gridview Adapter generates <div class="AspNet-GridView" id="ctl00_cphMain_gvChart"> that surrounds the Gridview.
    • The ASP.NET pagination code looks for an element ID called “__gvctl00_cphMain_gvChart__div” regardless of whether or not I'm using the adapter.

    Does anyone know if this is a known issue with CSS Friendly Gridview Adapter?
    Does anyone know if there is already a fix the making?  Or better yet, already available?
    Or does anyone know of a work around?

    Thanks again,

    Monday, December 22, 2008 9:42 AM
  • User1564426328 posted

    Hello again everyone,

    I found the solution!

    I had to remove the following statement from each of my gridviews:


     But I left the following statements in:

    AllowPaging="True" AllowSorting="True"

    That change allowed me to have working sorting and pagination. 

    NOTE: This was in an ASP.NET 3.5 project. 

    So, if you run into the same kind of situation, give it a try.


    Monday, December 22, 2008 1:13 PM