DataGrid Cell with an ImageButton In It

Discussion in 'ASP .Net Building Controls' started by KJ, Dec 15, 2003.

  1. KJ

    KJ Guest

    I create a datagrid and at runtime I add an ImageButton to certain
    cells(e.Item.Cells.Controls.Add(imgbutton)). Now when I click on a row
    that contain an image button, in the ItemCommand event the row is
    return.

    So I do e.Item.Cells(3) is the cell with the control in it supposely.
    When I do e.Item.Cells.Controls.Count it returns 0. Why? How can I
    tell if I clicked on a row with an imagebutton in cell 3?

    Thanks
    KJ, Dec 15, 2003
    #1
    1. Advertising

  2. Hi...

    Because control is dynamic (created at runtime)...


    "KJ" <> wrote in message
    news:...
    > I create a datagrid and at runtime I add an ImageButton to certain
    > cells(e.Item.Cells.Controls.Add(imgbutton)). Now when I click on a row
    > that contain an image button, in the ItemCommand event the row is
    > return.
    >
    > So I do e.Item.Cells(3) is the cell with the control in it supposely.
    > When I do e.Item.Cells.Controls.Count it returns 0. Why? How can I
    > tell if I clicked on a row with an imagebutton in cell 3?
    >
    > Thanks
    Eugene Jenihov, Dec 16, 2003
    #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. Chuck Hartman
    Replies:
    2
    Views:
    2,529
    Chuck Hartman
    Feb 18, 2004
  2. Bruce W.1
    Replies:
    0
    Views:
    381
    Bruce W.1
    Feb 25, 2004
  3. news.rcn.com
    Replies:
    1
    Views:
    9,659
    Chris Smith
    Jul 12, 2004
  4. Empire City
    Replies:
    3
    Views:
    406
    Empire City
    Apr 30, 2004
  5. RJ
    Replies:
    1
    Views:
    238
    Eliyahu Goldin
    Feb 17, 2005
Loading...

Share This Page