Hi,
Im trying to add a copy button in a grid view. First, I made a ButtonField that is working perfectly with a OnRowCommand event. Now, I try to do the samething with an image but I didnt found how to do it. I tried with an ImageButton in a TemplateField but I dont find how to fire the OnRowComment event or any other event (OnClick) that I can trap in the code behind.
Here is a part of the code I used. In this exemple, the ButtonField "Copy" work well and call GridView1_RowCommand in the code behing. But it doesnt work for the templetefield ImageButton.
Thanks for help
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="ObjectDataSource1"
CellPadding="4" ForeColor="#333333" GridLines="None" AllowPaging="True" AllowSorting="True" OnRowCommand="GridView1_RowCommand"
Width="100%" DataKeyNames="UdcTable,Udc">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:ImageButton runat="server" ID="imageButton" ImageUrl="~/Common/Images/copy.gif" CommandName="CopyButton" CommandArgument="Bidon" />
</ItemTemplate>
</asp:TemplateField>
<asp:ButtonField Text="Copy" CommandName="CopyButton" />
etc...
M. Schumacher