DataGrid and Repeater strange disappearance bug

Discussion in 'ASP .Net' started by Kepler, Nov 2, 2004.

  1. Kepler

    Kepler Guest

    I'm fighting a really strange bug that involves both a DataGrid and a
    Repeater disappearing on postback. The strange thing is that I've
    distilled the problem down to a simple program, that originally could
    reproduce the problem, but now can't, even as I add complexity back
    in.

    The basic scenario is a custom DataGrid (just make a class that
    derives from DataGrid) that has a LinkButton in a HeaderTemplate that
    has a CommandName="sort" and CommandArgument="whatever". Only
    DataBind if it's not a postback, and there you go. (I can give more
    code later). It's actually a bit more complicated in that sorting and
    paging are handled mostly within the control. I've intercepted almost
    all the handlers I can to see what is different between the working
    version and the non-working version (sometimes just a difference in
    time of day it seems). Here's what I found.

    Postback (when it's working):
    grid OnInit
    page OnInit
    grid LoadViewState
    grid CreateControlCollection
    grid InitializeItem
    page OnLoad
    grid OnLoad
    OnSortCommand

    Postback (when it doesn't work - and DataGrid disappears):
    grid OnInit
    page OnInit
    grid CreateControlCollection
    grid LoadViewState
    page OnLoad
    grid OnLoad

    The actual control is IDENTICAL in both cases. I'm pulling my hair
    out to figure out what is possibly different. This problem is driving
    me crazy, especially since I originally duplicated the problem in a
    simplified test case. Once I changed a small something that caused
    the problem to go away in the test case, I then went and changed it
    back, and WHAMMO, it didn't happen again. In fact, I can't get it to
    happen at all in my test case again, even though all the code is
    almost a duplicate of my bigger app. Any leads at all will be greatly
    appreciated. I'll post more code tomorrow.
    Kepler, Nov 2, 2004
    #1
    1. Advertising

  2. Kepler

    Scott Allen Guest

    Hi Tim:

    I think we will need to see some more code. When you do the sorting,
    is there any possibility you could be binding to an empty DataSource?

    --
    Scott
    http://www.OdeToCode.com/blogs/scott/

    On 1 Nov 2004 21:17:03 -0800, (Kepler)
    wrote:

    >I'm fighting a really strange bug that involves both a DataGrid and a
    >Repeater disappearing on postback. The strange thing is that I've
    >distilled the problem down to a simple program, that originally could
    >reproduce the problem, but now can't, even as I add complexity back
    >in.
    >
    >The basic scenario is a custom DataGrid (just make a class that
    >derives from DataGrid) that has a LinkButton in a HeaderTemplate that
    >has a CommandName="sort" and CommandArgument="whatever". Only
    >DataBind if it's not a postback, and there you go. (I can give more
    >code later). It's actually a bit more complicated in that sorting and
    >paging are handled mostly within the control. I've intercepted almost
    >all the handlers I can to see what is different between the working
    >version and the non-working version (sometimes just a difference in
    >time of day it seems). Here's what I found.
    >
    >Postback (when it's working):
    >grid OnInit
    >page OnInit
    >grid LoadViewState
    >grid CreateControlCollection
    >grid InitializeItem
    >page OnLoad
    >grid OnLoad
    >OnSortCommand
    >
    >Postback (when it doesn't work - and DataGrid disappears):
    >grid OnInit
    >page OnInit
    >grid CreateControlCollection
    >grid LoadViewState
    >page OnLoad
    >grid OnLoad
    >
    >The actual control is IDENTICAL in both cases. I'm pulling my hair
    >out to figure out what is possibly different. This problem is driving
    >me crazy, especially since I originally duplicated the problem in a
    >simplified test case. Once I changed a small something that caused
    >the problem to go away in the test case, I then went and changed it
    >back, and WHAMMO, it didn't happen again. In fact, I can't get it to
    >happen at all in my test case again, even though all the code is
    >almost a duplicate of my bigger app. Any leads at all will be greatly
    >appreciated. I'll post more code tomorrow.
    Scott Allen, Nov 2, 2004
    #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. Will Lastname

    Viewstate Disappearance

    Will Lastname, Sep 20, 2005, in forum: ASP .Net
    Replies:
    7
    Views:
    460
    Will Lastname
    Sep 22, 2005
  2. onetitfemme
    Replies:
    0
    Views:
    274
    onetitfemme
    Sep 16, 2006
  3. Replies:
    6
    Views:
    321
    Keith Thompson
    Jun 28, 2006
  4. Samuel Rhodes

    AJAX Modal Popup disappearance

    Samuel Rhodes, Apr 20, 2007, in forum: ASP .Net
    Replies:
    1
    Views:
    2,253
    Lloyd Sheen
    Apr 20, 2007
  5. Andrew Edwards
    Replies:
    3
    Views:
    93
    Brian Candler
    May 20, 2009
Loading...

Share This Page