In a similar scenario I explicitly set the server click event (see below):
<asp:TemplateColumn>
<ItemTemplate>
<asp:LinkButton Runat="server" Text="Submit"
OnClick="SubmitProfile_Click"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateColumn>
Then in the code I redirected the click event back to the ItemCommand event
for the grid:
Protected Sub SubmitProfile_Click(ByVal sender As Object, ByVal e As
EventArgs)
Dim btn As LinkButton = CType(sender, LinkButton)
'NOTE: I set the CommandName of the LinkButton to the ItemIndex for
where it exists in the ItemDataBound event for the grid
Me.myGrid_ItemCommand(Me, _
New
DataGridCommandEventArgs(myGrid.Items(Convert.ToIn t32(btn.CommandName)), _
myGrid, _
New CommandEventArgs("Select", Nothing)))
End Sub
HTH,
Matt Dinovo
"serge calderara" <se************@discussions.microsoft.com> wrote in
message news:2B**********************************@microsof t.com...
Dear all,
I gave a datagrid object wich has a template column define as follow :
<asp:TemplateColumn HeaderText="Evt">
<ItemTemplate>
<asp:ImageButton id="ImageButton2" ImageAlign=Middle runat="server"
ImageUrl="event.gif" CommandName="ShowEvent" CommandArgument
='<%#DataBinder.Eval(Container,"DataItem.ID")%>' >
</asp:ImageButton>
</ItemTemplate>
</asp:TemplateColumn>
When I click on my imagebutton I would like to trig the Command event of
the
image button ?
How can I do that because phisycally the imagebutton is not seen in code
as
it belongs to template
Or may be it is not working with it ?
Thnaks for your help
regards
serge