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","DoSomet hing()")
>
>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.
>.
>