Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
Find control in a templated column

Hey guys, 


I read somewhere that templated columns cannot be edited, so I dropped a textbox and a linkbutton right in the templated column in order to update the field:

<ig:TemplateDataField Key="URL" Header-Text="URL" >            

    <ItemTemplate >

        <a runat="server" id="URLLink" href='<%# Eval("URL")%>' >Link</a>

        <br />

        <asp:TextBox runat="server" ID="txtBxURL"></asp:TextBox> <asp:LinkButton runat="server" ID="lnkBttnChangeURL" Text="Update" CommandName="ChangeURL" CommandArgument='<%# Eval("RowID")%>'/>                    



The problem is I can't find a way to get a reference to the TextBox control. I tried the following line of code within the OnItemCommand event (fired by the link button):


but ItemTemplate doesn't seem to have a FindControl or some sort of collection of controls.

Any help would be appreciated.


Thanks !


Parents Reply Children