DataGrid OnItemBound find control

Discussion in 'ASP .Net' started by trinitypete, Aug 1, 2003.

  1. trinitypete

    trinitypete Guest

    Fixed it, the first item received in the onItemBound event
    is the datagrid header, this doesn't contain the button. I
    just have to ensure that I only check the body.

    Pete.
    >-----Original Message-----
    >Hi all,
    >
    >I have datagrid with a template column on it. This
    >template column contains a link button with an ID of
    >DeleteLink and it is server side. In the Datagrid
    >OnItemBound I try to locate the link button so i can add
    >client side script.
    >
    >i.e. ((LinkButton) e.Item.FindControl
    >("DeleteLink")).Attributes.Add("onclick","DoSomething()")
    >
    >I always get object reference not set or similar - Its

    not
    >finding the button with an ID of DeleteLink. If I let the
    >page render in the browser and look at the source the ID
    >of the link button has been renamed (prefixed with Cell
    >Name etc) Am I missing something here?
    >
    >Pete.
    >.
    >
    trinitypete, Aug 1, 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. rockdale
    Replies:
    0
    Views:
    508
    rockdale
    Jun 7, 2006
  2. Replies:
    0
    Views:
    152
  3. Wybo Dekker
    Replies:
    1
    Views:
    337
    Yukihiro Matsumoto
    Nov 15, 2005
  4. vdvorkin
    Replies:
    0
    Views:
    387
    vdvorkin
    Feb 10, 2011
  5. vdvorkin
    Replies:
    3
    Views:
    792
    vdvorkin
    Feb 14, 2011
Loading...

Share This Page