'itemcommand' event not firing

Discussion in 'ASP .Net Datagrid Control' started by Richard Murphy, Nov 11, 2003.

  1. Hi All,

    I've been on this problem for many hours now and checked many posts and
    forums but can still not find an answer. I hope someone can help.

    I have a Datalist (I know its not a datagrid- but close enough) with a
    template column in it which contains a button. The
    datalist is in an ascx control that is loaded dynamically by the parent aspx
    control. The problem the 'itemcommand' event is no longer being fired on
    postback in response to the users click. I have tried everything I can think
    of.
    The event is definitely wired up - the datalist is only bound once within
    the
    !Page.Ispostback statement. The event was firing once before and now,
    although I have changed nothing within the code that I know, all of a sudden
    it does not. There is a possibility that something in one of the parent
    containers controls has changed that could effect it but nothing that I know
    of. I have tried creating a separate aspx page and replicating the datalist
    there - the event fires no problem in this - it just doesn't work in the
    child ascx controls. Any ideas?

    Any clue may be that it seems the Viewstate is not working as the when the
    control reloads the grid elements are not showing anymore. However I have
    tried
    enabling viewstate but get the same result.

    Any help would be really, really appreciated.

    Regards

    Richard Murphy
    espod.com
     
    Richard Murphy, Nov 11, 2003
    #1
    1. Advertising

  2. OK - it's solved!

    It seems a change had been made to the parent control of the control with
    the datalist in it that caused it to get loaded in the 'inializecomponent'
    function. which screwed up the viewstate for the datalist.

    "Richard Murphy" <> wrote in message
    news:...
    > Hi All,
    >
    > I've been on this problem for many hours now and checked many posts and
    > forums but can still not find an answer. I hope someone can help.
    >
    > I have a Datalist (I know its not a datagrid- but close enough) with a
    > template column in it which contains a button. The
    > datalist is in an ascx control that is loaded dynamically by the parent

    aspx
    > control. The problem the 'itemcommand' event is no longer being fired on
    > postback in response to the users click. I have tried everything I can

    think
    > of.
    > The event is definitely wired up - the datalist is only bound once within
    > the
    > !Page.Ispostback statement. The event was firing once before and now,
    > although I have changed nothing within the code that I know, all of a

    sudden
    > it does not. There is a possibility that something in one of the parent
    > containers controls has changed that could effect it but nothing that I

    know
    > of. I have tried creating a separate aspx page and replicating the

    datalist
    > there - the event fires no problem in this - it just doesn't work in the
    > child ascx controls. Any ideas?
    >
    > Any clue may be that it seems the Viewstate is not working as the when the
    > control reloads the grid elements are not showing anymore. However I have
    > tried
    > enabling viewstate but get the same result.
    >
    > Any help would be really, really appreciated.
    >
    > Regards
    >
    > Richard Murphy
    > espod.com
    >
    >
     
    Richard Murphy, Nov 11, 2003
    #2
    1. Advertising

  3. Richard Murphy

    Guest

    I am having the EXACT same problem...... and banging my
    head against the wall!

    Could you please post more details as to what you found
    and how you fixed, etc....

    Thanks!

    Brian

    >-----Original Message-----
    >OK - it's solved!
    >
    >It seems a change had been made to the parent control

    of the control with
    >the datalist in it that caused it to get loaded in

    the 'inializecomponent'
    >function. which screwed up the viewstate for the

    datalist.
    >
    >"Richard Murphy" <> wrote in message
    >news:...
    >> Hi All,
    >>
    >> I've been on this problem for many hours now and

    checked many posts and
    >> forums but can still not find an answer. I hope

    someone can help.
    >>
    >> I have a Datalist (I know its not a datagrid- but

    close enough) with a
    >> template column in it which contains a button. The
    >> datalist is in an ascx control that is loaded

    dynamically by the parent
    >aspx
    >> control. The problem the 'itemcommand' event is no

    longer being fired on
    >> postback in response to the users click. I have tried

    everything I can
    >think
    >> of.
    >> The event is definitely wired up - the datalist is

    only bound once within
    >> the
    >> !Page.Ispostback statement. The event was firing once

    before and now,
    >> although I have changed nothing within the code that I

    know, all of a
    >sudden
    >> it does not. There is a possibility that something in

    one of the parent
    >> containers controls has changed that could effect it

    but nothing that I
    >know
    >> of. I have tried creating a separate aspx page and

    replicating the
    >datalist
    >> there - the event fires no problem in this - it just

    doesn't work in the
    >> child ascx controls. Any ideas?
    >>
    >> Any clue may be that it seems the Viewstate is not

    working as the when the
    >> control reloads the grid elements are not showing

    anymore. However I have
    >> tried
    >> enabling viewstate but get the same result.
    >>
    >> Any help would be really, really appreciated.
    >>
    >> Regards
    >>
    >> Richard Murphy
    >> espod.com
    >>
    >>

    >
    >
    >.
    >
     
    , Nov 20, 2003
    #3
    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?RGVlcGVzaA==?=

    Datagrid ItemCommand Event Not Firing

    =?Utf-8?B?RGVlcGVzaA==?=, Oct 5, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    5,825
    =?Utf-8?B?RGVlcGVzaA==?=
    Oct 6, 2005
  2. EvelynAnd Ethan
    Replies:
    4
    Views:
    980
    =?Utf-8?B?Sko=?=
    Jan 9, 2006
  3. EvelynAnd Ethan
    Replies:
    0
    Views:
    404
    EvelynAnd Ethan
    Oct 17, 2005
  4. EvelynAnd Ethan
    Replies:
    0
    Views:
    547
    EvelynAnd Ethan
    Oct 17, 2005
  5. =?Utf-8?B?ZGFuYw==?=

    DataGrid ItemCommand event not firing if not first page

    =?Utf-8?B?ZGFuYw==?=, Oct 26, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    4,155
    =?Utf-8?B?ZGFuYw==?=
    Oct 26, 2005
Loading...

Share This Page