Dynamic separator row causing ButtonColumn event wiring problems

Discussion in 'ASP .Net Datagrid Control' started by zigjog, Sep 29, 2003.

  1. zigjog

    zigjog Guest

    Hello,

    I have been attempting to create a Datagrid that inserts a separator row
    between databound rows using code recommended by DataGrid Girl in this post
    (http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&newwindow=1&safe=off&fra
    me=right&th=62db3580fd5c42b6&seekm=efzXR7L0CHA.2736%40TK2MSFTNGP09#link4)

    This works great until I try to start using ButtonColumns in my datagrid.
    When I use ButtonColumns in conjunction with this code to insert separators,
    not all of my buttons fire the command event. Specifically, buttons toward
    the bottom of the list tend to not work where buttons at the top of the list
    do.

    Let's take a simple example where I have a list of two items and each row
    has a "Remove" link button at the end of it that I've defined with a
    ButtonColumn. If I don't add the separator using the method described in
    the link above, both buttons work as expected. If I do add the separators,
    only the top button works.

    If you look at the source of the HTML that is generated when I do not
    include the separator, my link buttons are calling
    javascript:__doPostBack('MyDataGrid:_ctl2:ctl0','') in the first row and
    javascript:__doPostBack('MyDataGrid:_ctl3:ctl0','') in the second row. When
    I do include the separator, the code for the 2nd button has now changed to
    javascript:__doPostBack('MyDataGrid:_ctl4:ctl0',''). Notice how it's now
    ctl4 instead of clt3.

    I can only guess that the event wiring is taking place to ctl3 before I add
    my separator and that ctl4 is never considered in the equation.

    Does anyone have any suggestions for how I can get both the separator row
    added to my datagrid and have my link button events fire as well?

    Thanks.

    Jamie
     
    zigjog, Sep 29, 2003
    #1
    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. Oisin Grehan
    Replies:
    3
    Views:
    490
    Natty Gur
    Jul 15, 2003
  2. =?Utf-8?B?SG9tYW0=?=

    Dynamic controls and event wiring

    =?Utf-8?B?SG9tYW0=?=, Feb 16, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    372
    =?Utf-8?B?SG9tYW0=?=
    Feb 16, 2005
  3. Jordan
    Replies:
    4
    Views:
    626
    Bruce Barker
    Sep 1, 2005
  4. Hardy Wang
    Replies:
    2
    Views:
    7,985
    Hardy Wang
    Sep 15, 2006
  5. brett

    Wiring up dynamic control

    brett, Feb 13, 2007, in forum: ASP .Net
    Replies:
    4
    Views:
    384
    brett
    Feb 20, 2007
Loading...

Share This Page